会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
喵小喵~
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
45
46
47
48
49
50
51
52
53
···
68
下一页
2018年1月28日
48.结构体位域获取内存模型
摘要: 数据在linux和windows上是低字节在地位,高字节在高位,以此方法可以验证运行结果: 1 #include 2 #include 3 4 struct weiyu 5 { 6 unsigned char w0 : 1; 7 unsigned char w1 : 1; 8 unsigned char w2 : 1; 9 unsigne...
阅读全文
posted @ 2018-01-28 12:16 喵小喵~
阅读(143)
评论(0)
推荐(0)
2018年1月27日
15.字符串用密码加密
摘要: 运行结果: 源代码:
阅读全文
posted @ 2018-01-27 15:52 喵小喵~
阅读(588)
评论(0)
推荐(0)
14.字符串hash寻找第一个只出现一次的字符
摘要: 1 //char 0-255一共256个 2 char getonebyhash(char *str) 3 { 4 if (str == NULL) 5 { 6 return '\0'; 7 } 8 char ch = '\0'; 9 //哈希表设置为0 10 int hashtable[256] = { 0 };...
阅读全文
posted @ 2018-01-27 15:14 喵小喵~
阅读(139)
评论(0)
推荐(0)
13.字符串压缩算法
摘要: mark
阅读全文
posted @ 2018-01-27 14:56 喵小喵~
阅读(279)
评论(0)
推荐(0)
12.字符串全部替换指定文本
摘要: 运行结果: 完整代码:
阅读全文
posted @ 2018-01-27 11:50 喵小喵~
阅读(239)
评论(0)
推荐(0)
2018年1月26日
46.数字到字符串的转换
摘要: double类型转换到char* 1 char buffer[128]; 2 double value = 12.2345678; 3 _gcvt(value, 5, buffer);//5有效数字 4 printf("%s", buffer); unsigned int类型转换到char* 1 u
阅读全文
posted @ 2018-01-26 20:41 喵小喵~
阅读(436)
评论(0)
推荐(0)
45.切割字符串并精确分配内存
摘要: 运行结果: 源代码:
阅读全文
posted @ 2018-01-26 17:01 喵小喵~
阅读(181)
评论(0)
推荐(0)
44.字符串删除指定字符或者字符串
摘要: 1 #include 2 #include 3 #include 4 5 //字符串中删除某一个字符 6 void deletech(char *str,char ch) 7 { 8 if (str == NULL) 9 { 10 return; 11 } 12 13 char *pstr = str; 14 w...
阅读全文
posted @ 2018-01-26 15:34 喵小喵~
阅读(432)
评论(0)
推荐(0)
11.表达式计算对一串加减乘除带括号进行计算
摘要: 算法流程图: 执行截图: 完整代码:
阅读全文
posted @ 2018-01-26 14:45 喵小喵~
阅读(1272)
评论(0)
推荐(0)
2018年1月25日
43.可变参数实现printf
摘要: 1 #include 2 #include 3 #include 4 #include 5 6 void myprintf(char *ptstr, ...)//可变参数 7 { 8 va_list ap;//起始点 9 va_start(ap, ptstr);//从ptstr开始向后读取数据存放在ap中 10 char flag;//依次读...
阅读全文
posted @ 2018-01-25 20:29 喵小喵~
阅读(162)
评论(0)
推荐(0)
上一页
1
···
45
46
47
48
49
50
51
52
53
···
68
下一页
公告