#include <windows.h>
#include <string.h>
#include <stdio.h>
int main(void)
{
char* str1 = "c windows programming";
char* str2 = "strnlen takes a maximum size. If the string is longer\n"
"than the maximum size, the maximum size is\n"
"returned not the actual size of the string";
size_t len;
size_t maxsize = 25;
len = strnlen(str1, maxsize);
printf("%zu\n", len);
len = strnlen(str2, maxsize);
printf("%zu \n", len);
char ch = getchar();
return 0;
}
/*
run:
21
25
*/