note 54593 rejected from function.strcmp by betz
| From: | betz@php.net | Date: | Fri, 08 Jul 2005 17:17:06 +0000 |
| Subject: | note 54593 rejected from function.strcmp by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91688@lists.php.net to get a copy of this message | ||
Note Submitter: harry dot pool at boeing dot com
----
I don't understand why an on-line exam question in a C course says I should have selected
"s1 less than s2" after
strcpy(s1, "machine");
strcpy(s2, "computer");
if (strcmp(s1, s2)==0
printf("equal\n);
else if (strcmp(s1, s2)<0)
printf("s1 less than s2\n");
else
printf("s1 greater than s2\n");
I selected "s1 greater than s2" because I expect 'm' > 'c'.
Unfortunately, I don't have a C compiler I can test with.