C. J. Clegg <an*****************@no.spamwrites:
Consider this code:
char* s;
char* putSomethingThere( void );
s = putSomethingThere( );
if( s == "abc" )
{
...
}
If I remember correctly, that's correct C++ but incorrect C, even if
putSomethingThere() put "abc" into s, right?
The comp.lang.c FAQ is at <http://www.c-faq.com/>. You've just asked
question 8.2.
<OFFTOPIC>
The above code probably means the same thing in C++ as it does in C,
but C++ has other features that let you use the "==" operator to
compare strings. For details, consult a C++ textbook; if that fails,
ask in comp.lang.c++.
</OFFTOPIC>
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"