摘要:
数组做sizeof的参数不退化,传递给strlen就退化为指针; 1 #include 2 #include 3 #include 4 //#define PE(x) printf("sizeof("); printf(#x") = %d\n", sizeof(x)) 5 6 void func(char str[100]) 7 { 8 printf("func(sizeof(str) = %d)\n", sizeof(str)); 9 }10 int main()11 {12 char str[] = "hello&quo 阅读全文