Create winapi_string_concat.c

This commit is contained in:
Jan Bodnar 2016-04-07 15:40:43 +02:00
parent 14dc3fd2f1
commit c2d3ebaad8

View File

@ -0,0 +1,23 @@
#include <windows.h>
#include <wchar.h>
int main(void) {
wchar_t *s1 = L"ZetCode, ";
wchar_t *s2 = L"tutorials ";
wchar_t *s3 = L"for ";
wchar_t *s4 = L"programmers.\n";
int len = lstrlenW(s1) + lstrlenW(s2)
+ lstrlenW(s3) + lstrlenW(s4);
wchar_t buf[len+1];
lstrcpyW(buf, s1);
lstrcatW(buf, s2);
lstrcatW(buf, s3);
lstrcatW(buf, s4);
wprintf(buf);
return 0;
}