
内存
文章平均质量分 61
viewtosay
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
sizeof的一点总结
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--= char str[] = "hello"; sizeof(str) = 6; void *p = malloc(100); sizeof(p) = 4; 数组和指针的sizeof运算有着细微的区别:如果数组变量被传入函数中做sizeof运算,则和指针运算没有区别!原创 2012-05-12 18:14:59 · 348 阅读 · 0 评论 -
从字符串的指定位置开始,删除指定长度字符
//领会指针和其它内存操作的技巧 char *deleteChars(char *str,int pos,int len) { char *p = str + pos -1;//指向pos位置字符 int tt = strlen(str); if (pos tt) { return str; } if( (p+len-str) > tt)//len大于pos后剩余的字符个数,只需原创 2012-05-12 17:23:55 · 1078 阅读 · 0 评论 -
字符长度
以下是在centos_x32和centos_x64下对应的类型长度: /*******size of types on centos_x32*****************/ size of char:1 size of int:4 [-2^32/2---2^32/2] size of unsigned int:4 [0---2^32] size of long :4 size原创 2012-05-12 18:42:08 · 360 阅读 · 0 评论