char *s = "Hello"
char s[6] = "Hello"
上述任何一种语法都可以正常工作.
但是关注呢?
int a[3] = {1,2,3}
int *a = {1, 2, 3};
解释以及案例[2]和[4]之间的比较将会有所帮助.
c arrays string pointers initialization
arrays ×1
c ×1
initialization ×1
pointers ×1
string ×1