char pointer
#Char Pointer
char pointer 可以直接類似當作變數用, 因為字元指標可以直接參考到字串常數
char *str = "Hello";
str = "World";
注意 - 如果是陣列則不行:
ex:
char str[] = "Hello";
str = "World"; //error incompatible type in assignment
Last updated
#Char Pointer
char pointer 可以直接類似當作變數用, 因為字元指標可以直接參考到字串常數
char *str = "Hello";
str = "World";
注意 - 如果是陣列則不行:
ex:
char str[] = "Hello";
str = "World"; //error incompatible type in assignment
Last updated