RE: [Dev-C++] I am new to C ++ and need some help
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2000-12-12 11:17:13
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Nick > Sent: Tuesday, December 12, 2000 9:48 AM > To: dev...@li... > Subject: RE: [Dev-C++] I am new to C ++ and need some help > > > > Hello, > > > In fact the following stuff can be used in C++ only. > > > > char s1[20], s2[20]; > > ... > > > > if(s1==s2) > > ... > > > > The overloaded string operator == accepts 2 strings (objects) and the > > C-style strings are "upgraded" to temporary strings so as the > > comparison to work. > > You can use == as long as one of the arguments is a (C++) string > object. In your example above, it does not use the string operator. Oops, you are absolutely right, it is pointer comparison. Ioannis __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com |