2010年10月23日 星期六

C string is constant!?

char s[]={'c','o','\0'};
and
char s[]="co";
are equal.
--------------------------------------------------------------
char * s = "co"; //this is a constant string
function("abc");
//"abc" is also a constant string. You can not change this string
It's just like
const char s[]="co";

沒有留言:

張貼留言