若不标志字符数组结束符,输出将出现乱码; char c[10]; c[0]='a'; //c[1]='/0'; cout << c;出现乱码 对string类型变量cin默认结束符首选为' ',其次'/n';