// sizeof里边放数组名,传首元素地址 #include <stdio.h> void example(char acHello[]) { printf("%d\n", sizeof(acHello)); return 0; } int main() { char acHello[] = "hello,tu_lun"; example(acHello); return 0; }
时间: 2024-10-29 19:09:49
// sizeof里边放数组名,传首元素地址 #include <stdio.h> void example(char acHello[]) { printf("%d\n", sizeof(acHello)); return 0; } int main() { char acHello[] = "hello,tu_lun"; example(acHello); return 0; }