老师给的题目不是很会
程序代码:
#include <stdio.h> #include <string.h> int main() { short a[] = { -1, 257, 123, 62, 91, 18, 44, 73, 0, 26 }; short* p = &a[1], * q = a + 5; short x = *++p, y = *(q + 1); char* str = (char*)a; short z = strlen(str); }
#include <stdio.h> #include <string.h> int main() { short a[] = { -1, 257, 123, 62, 91, 18, 44, 73, 0, 26 }; short* p = &a[1], * q = a + 5; short x = *++p, y = *(q + 1); char* str = (char*)a; short z = strlen(str); }
#include <stdio.h> #include <string.h> int main( void ) { short a[] = { -1, 257, 123, 62, 91, 18, 44, 73, 0, 26 }; size_t z = strlen( (char*)a ); printf( "%zu\n", z ); }
[此贴子已经被作者于2023-1-30 16:10编辑过]
[此贴子已经被作者于2023-1-31 16:26编辑过]
[此贴子已经被作者于2023-2-3 07:53编辑过]