1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
/* wcscmp example */
#include <stdio.h>
#include <wchar.h>
int main ()
{
wchar_t wsKey[] = L"apple\n";
wchar_t wsInput[80];
do {
wprintf (L"Guess my favourite fruit? ");
fgetws (wsInput,80,stdin);
} while (wcscmp (wsKey,wsInput) != 0);
fputws (L"Correct answer!",stdout);
return 0;
}
|