mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2026-08-07 18:34:45 -04:00
Create winapi_string_concat.c
This commit is contained in:
parent
14dc3fd2f1
commit
c2d3ebaad8
23
strings/winapi_string_concat.c
Normal file
23
strings/winapi_string_concat.c
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user