I ipshita Estimable Jan 18, 2015 2 0 4,510 Jan 18, 2015 #1 i am able to do it with numerals but difficulty arises with strings and the comparisons as well
rgd1101 Don't Moderator Nov 7, 2011 17,898 225 87,600 Jan 18, 2015 #2 school work? talk to your teacher. Upvote 0 Downvote
A Alabalcho Judicious Jan 13, 2011 4,162 4 35,260 Jan 18, 2015 #3 If you compare numbers with statement like Code: if (a < b) then something(); else (anotherthing); you can compare strings like Code: if (strcmp(s1,s2) < 0) then somehingwhen_less_(); Read your notes / textbooks about how strings are ordered, that is why ABC is considered "less than" ABD, Upvote 0 Downvote
If you compare numbers with statement like Code: if (a < b) then something(); else (anotherthing); you can compare strings like Code: if (strcmp(s1,s2) < 0) then somehingwhen_less_(); Read your notes / textbooks about how strings are ordered, that is why ABC is considered "less than" ABD,