cout << a<< endl; 如果 a是 int *,那么会显示地址,如果a是char *, 那么<< 内置有重载,会输出a的地址内容。把a当初字符串的首地址了。 所以要得到字符串的地址,必须要 cout << &a <<endl;