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/strerr_s.c

17 lines
314 B
C
Raw Permalink Normal View History

#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <string.h>
#include <errno.h>
void main()
{
FILE *fp;
char emsg[ 100 ];
fp = fopen( "file.nam", "r" );
if( fp == NULL ) {
strerror_s( emsg, sizeof( emsg ), errno );
printf( "Unable to open file: %s\n", emsg );
}
}