![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔试题
Yukle
这个作者很懒,什么都没留下…
展开
-
C语言字符串内存函数的实现
一.求字符串长度 ①.strlen size_t strlen ( const char * str ); 字符串已经 '\0' 作为结束标志,strlen函数返回的是在字符串中 '\0' 前面出现的字符个数(不包含 '\0' )。 参数指向的字符串必须要以 '\0' 结束。 注意函数的返回值为size_t,是无符号的( 易错 ) 例题: int main(){//返回值为size_t,是无符号的 const char*str1 = "abcdef"; const char*str2 = "bbb"原创 2020-06-26 13:20:37 · 176 阅读 · 0 评论 -
指针的笔试题详解
笔试题1: int main() { int a[5] = { 1, 2, 3, 4, 5 }; int *ptr = (int *)(&a + 1); printf( "%d,%d", *(a + 1), *(ptr - 1)); return 0; } 运行结果: 笔试题二: struct Test { int Num; char *pcName; short sDate; char cha[2]; short sBa[4]; }*p; //假设p 的值为0x100000。原创 2020-06-06 19:22:42 · 368 阅读 · 0 评论