#include using namespace std;void sub(char b[]){ b[]="world";}int main(void){ char a[]="hello"; sub(a); cout<}
b[]="world";这种写法,只有定义变量的时候直接初始化才可以变量定义完以后只能用字符串拷贝了strcpy(b,"world");