【发布时间】:2010-05-31 02:44:52
【问题描述】:
我正在使用 c++ 字符串,并且是编程的初学者。
我期待:99 个红气球
但我收到:99 个红气球
这是为什么呢?
#include <string>
#include <iostream>
using namespace std;
int main()
{
string text = "9";
string term( "9 ");
string info = "Toys";
string color;
char hue[4] = {'R','e','d','\0'};
color = hue;
info = "Balloons";
text += (term + color + info);
cout << endl << text << endl;
return 0;
}
【问题讨论】: