Create ansic_functions.c

This commit is contained in:
Jan Bodnar 2016-04-07 15:38:26 +02:00
parent ed170d287a
commit fe6be83b1d

26
strings/ansic_functions.c Normal file
View File

@ -0,0 +1,26 @@
#include <windows.h>
#include <wchar.h>
#define STR_EQUAL 0
int wmain(void) {
wchar_t str1[] = L"There are 15 pines";
wprintf(L"The length of the string is %lld characters\n", wcslen(str1));
wchar_t buf[20];
wcscpy(buf, L"Wuthering");
wcscat(buf, L" heights\n");
wprintf(buf);
if (wcscmp(L"rain", L"rainy")== STR_EQUAL) {
wprintf(L"rain and rainy are equal strings\n");
} else {
wprintf(L"rain and rainy are not equal strings\n");
}
return 0;
}