输入字符串 和输出字符串那里总报错 编译工具 VS2013

//2.Enter three strings, in order from small to large outputint selectThreeStrings(){ void changeString(string &st1, string &st2); string str1, str2, str3;// char *p1 = &str1[0], *p2 = &str2[0], *p3 = &str3[0]; cout << "input three strings:" << endl; cin >> str1; cin >> str2; cin >> str3; if (str1 > str2)changeString(str1, str2); if (str1 > str3)changeString(str1, str3); if (str2 > str3)changeString(str2, str3); cout << endl << "Now the order is:" << endl; cout << str1 << endl << str2 << endl << str3 << endl; return 0;}

#include <string>
就可以了。
不上述的头文件的话,需要把string换成char*;
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网