字符串和字符数组

char dog[5] = {'a','b','c','d','e'};//not a string

char cat[5] = {'a','b','c','d','\0'};//a string

c-风格字符串以空字符结尾,空字符被写作\0,其ASCII码为0.

posted @ 2012-08-17 22:11  ValeTu  阅读(172)  评论(0编辑  收藏  举报