Past paper question from 2007:
Source University of Cape Town - CSC2001F - 2007
Which of the two statements shown below will provide an lexicographical (alphabetic) string comparsion?
why?
char *mesg1 = "Hello", *mesg2 = "world";
string s1 = "Hello", s2 = "world";
if (s1 != s2) {...} // statement 1
if (mesg1 != mesg2 ) {...} // statement 2
I thought both of these would provide alphabetic string comparison... But I guess I'm wrong.. What would be the correct answer