>#include<iostream.h></P>3 m% ^. K/ E; o U& h
>void main()</P>
>{</P>2 R; y, r. e& z1 u- Y! Y9 B
>if("join"=="join")</P>( ~* ^% ]/ `0 K2 a
>cout<<"equal\n";</P>: T9 W k9 ]; y3 [& q8 Y/ F9 d
>else</P>
>cout<<"not equal\n";</P>
>}</P>
>运行结果:equal</P>
>钱能的 c++教程的168页,却说是not equal。解释说字符串比较地址,可是两个join的地址不同,故不相等。与运行相反。请问这是为什么?</P>| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |