This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/strnln_s.c

14 lines
279 B
C
Raw Normal View History

#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <string.h>
void main()
{
char buffer[ 30 ] = "Hello world.";
size_t len;
len = strnlen_s( buffer, sizeof( buffer ) );
printf( "Length of text: %d\n", len );
printf( "Text: %s\n", buffer );
}