string str("HelloC++");
cout<<str.substr(5,3);
程序的输出结果是___。
答案: C++
[解析]substr取子字符串,第1个参数表示要截取子串在字符串中的位置,第2个表示取多少个字符。
川公网安备 51010402001278号