1 //输出10 和 9 2 #include <iostream> 3 #include <cstring> 4 using namespace std; 5 6 int main() 7 { 8 char p[] = "12中国abc"; 9 int ans = sizeof(p); 10 int len = strlen(p); 11 cout<<ans<<" "<<len<<endl; 12 while(1); 13 return 0; 14 } 15
1 //输出10 和 9 2 #include <iostream> 3 #include <cstring> 4 using namespace std; 5 6 int main() 7 { 8 char p[] = "12中国abc"; 9 int ans = sizeof(p); 10 int len = strlen(p); 11 cout<<ans<<" "<<len<<endl; 12 while(1); 13 return 0; 14 } 15