0053-wmemcmp.c - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
0053-wmemcmp.c (431B)
---
1 #include <assert.h>
2 #include <stdio.h>
3 #include <wchar.h>
4
5 /*
6 output:
7 testing
8 done
9 end:
10 */
11
12 int
13 main(void)
14 {
15 wchar_t buf[40] = {1, 2, 3, 4, 5};
16
17 puts("testing");
18 assert(wmemcmp(buf, (wchar_t[]) {1, 2, 3, 4, 5}, 5) == 0);
19 assert(wmemcmp(buf, (wchar_t[]) {1, 1, 1, 1, 1}, 5) > 0);
20 assert(wmemcmp(buf, (wchar_t[]) {1, 3, 1, 1, 1}, 5) < 0);
21 assert(wmemcmp(buf, (wchar_t[]) {2, 3, 4, 5, 6}, 0) == 0);
22 puts("done");
23
24 return 0;
25 }