scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

0264-wchar.c (282B)


      1 #include <wchar.h>
      2 
      3 #define W(L) L"Hello " L
      4 
      5 int
      6 test(wchar_t *ws)
      7 {
      8 	int i;
      9 	static wchar_t str[] = L"Hello World!!!!!";
     10 
     11 	for (i = 0; ws[i] != L'\0'; ++i) {
     12 		if (ws[i] != str[i])
     13 			return 1;
     14 	}
     15 
     16 	return 0;
     17 } 
     18 
     19 int
     20 main(void)
     21 {
     22 	wchar_t *ws = W(L"World!");
     23 
     24 	return test(ws);
     25 }