r*******y 发帖数: 1081 | 1 we can not do this.
But what is the point? why we can not
say string s = "hi" + "hi"
what is the reason for this rule ?
thanks |
D*******a 发帖数: 3688 | 2 string literals are not c++ string objects.
【在 r*******y 的大作中提到】 : we can not do this. : But what is the point? why we can not : say string s = "hi" + "hi" : what is the reason for this rule ? : thanks
|
p***o 发帖数: 1252 | 3 There is no need to use '+'.
【在 r*******y 的大作中提到】 : we can not do this. : But what is the point? why we can not : say string s = "hi" + "hi" : what is the reason for this rule ? : thanks
|
r*******y 发帖数: 1081 | 4 thanks.
【在 D*******a 的大作中提到】 : string literals are not c++ string objects.
|
a***y 发帖数: 2803 | 5 cout <<"hi" <<"hi";
【在 r*******y 的大作中提到】 : we can not do this. : But what is the point? why we can not : say string s = "hi" + "hi" : what is the reason for this rule ? : thanks
|
p***o 发帖数: 1252 | 6 Why bother? Just use cout << "hi" "hi";
【在 a***y 的大作中提到】 : cout <<"hi" <<"hi";
|
a***y 发帖数: 2803 | 7 why bother? just use cout<<"hihi";
【在 p***o 的大作中提到】 : Why bother? Just use cout << "hi" "hi";
|
j*******d 发帖数: 8834 | 8 why bother? just use write (1, "hihi", 4);
【在 a***y 的大作中提到】 : why bother? just use cout<<"hihi";
|
w****i 发帖数: 964 | 9 why bother? just hihi
【在 j*******d 的大作中提到】 : why bother? just use write (1, "hihi", 4);
|
D*******a 发帖数: 3688 | 10 you guys have too much time
【在 w****i 的大作中提到】 : why bother? just hihi
|
t*****n 发帖数: 225 | 11 do you mean this?
//
cout<<(string("hi")+=string("hi")).c_str();
// |