由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - cout << ("hi" + "hi")
相关主题
C++ Strategies and Tactics 书上一个问题求助菜鸟请教smart pointer
string reverseC++一问
what's the outcome?C++11 unique_ptr问题?
C++ string to int Problem谁能告诉为啥最后为啥输出两个C
VC++ 6.0 弱问,多谢解答which func will be called?
一个小程序差点搞死了g++,怎么回事?C++疑问
请教一个c++ map问题how do I reseat a reference?
wiki上关于map的这段程序为什么不work?【C++】请问这样有没有memory leak?多谢
相关话题的讨论汇总
话题: hi话题: cout话题: string话题: why话题: what
进入Programming版参与讨论
1 (共1页)
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();
//
1 (共1页)
进入Programming版参与讨论
相关主题
【C++】请问这样有没有memory leak?多谢VC++ 6.0 弱问,多谢解答
TIJ上写错了?一个小程序差点搞死了g++,怎么回事?
请问个c++ primer里面的小白问题.请教一个c++ map问题
Pattern matchingwiki上关于map的这段程序为什么不work?
C++ Strategies and Tactics 书上一个问题求助菜鸟请教smart pointer
string reverseC++一问
what's the outcome?C++11 unique_ptr问题?
C++ string to int Problem谁能告诉为啥最后为啥输出两个C
相关话题的讨论汇总
话题: hi话题: cout话题: string话题: why话题: what