摘要:
中提到的临时变量:见10.4.10节其中有这样一个例子:void f(string& s1,string& s2,string& s3){ const char* cs = (s1+s2).c_str(); cout<<cs; if( strlen(cs=(s2+s3).c_str())<8 && cs[0] == 'a'){ //cs used here }} 刚开始还以为没什么错误,后来经过测试发现,cs中的内容是不确定的。主要是因为(s1+s2)生成的临时变量在其所在语句执行完毕... 阅读全文
posted @ 2014-01-23 10:17
熠熠生辉
阅读(580)
评论(0)
推荐(0)

浙公网安备 33010602011771号