0055-wcscat.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
       ---
       0055-wcscat.c (467B)
       ---
            1 #include <assert.h>
            2 #include <stdio.h>
            3 #include <wchar.h>
            4 
            5 /*
            6 output:
            7 testing
            8 ok
            9 end:
           10 */
           11 
           12 int
           13 main(void)
           14 {
           15         wchar_t *s, buf[40];
           16 
           17         puts("testing");
           18         wcscpy(buf, L"case1:");
           19         s = wcscat(buf, L"ok");
           20         assert(s == buf);
           21         assert(!wcscmp(s, L"case1:ok"));
           22 
           23         wcscpy(buf, L"");
           24         s = wcscat(buf, L"ok");
           25         assert(s == buf);
           26         assert(!wcscmp(s, L"ok"));
           27 
           28         wcscpy(buf, L"case1:");
           29         wcscat(buf, L"");
           30         assert(s == buf);
           31         assert(!wcscmp(s, L"case1:"));
           32 
           33         puts("ok");
           34 
           35         return 0;
           36 }