首页 > 代码库 > C语言中字符、字符串、字符数组

C语言中字符、字符串、字符数组

char a = ‘h‘;

memory
h

 

char a[] = "Hello";

memory          
H e l l o ‘\0‘

 

string sComparec = "Hello"

memory            
H e l l o ‘\0‘  

 

char *a = "Hello";

                                 技术分享

 

char* mag[] = {

          "Love Stor",

          "Harry",

          "Potter"

        };                        

L o v e   S t o r

‘\0‘

H a r r y ‘\0‘        
P o t t e r ‘\0‘      

拓展知识点: 

getchar();

EOF(文件描述符)

C语言中字符、字符串、字符数组