#define STDC_WANT_LIB_EXT1 1
#include
#include
int main()
{
char str1 = "to or not to be.";
printf("the string:\n \"%s\"\ncontains %zu characters and %zu bites.",str1,strnlen_s(str1,sizeof(str1)), sizeof(str1));
return 0;
}
#include<stdio.h>
#include<string.h>
int main(){
char str[]="to be or not to be";
printf("the string:\n%s\n",str);
printf("contains %d characters and %d bites",strlen(str),sizeof(str));
return 0;
}