数组的大小及定义sizeof和strlen

 
  
char a[] = "abcd";
char b[] = {'a','b','c','e','f'};
int d = strlen(a);//4
int e = strlen(b);//16
cout << d << " " << e << endl;
cout << a[2]<<" "<


 
  

你可能感兴趣的:(小知识点)