C语言中字符串的几种定义方式

char a[5]="hello";

 第2种 

char a[]="hello"; 

 第3种

char* a="hello"; 

 第4种

char a[10];  
gets(a);  

 第5种 

char* a[5]={"hello",  
"nihao",  
"good",  
"ok",  
"bye"};  

  

猜你喜欢

转载自www.cnblogs.com/addserver/p/9167302.html