FILE * file = fopen( “in.txt”, “r” );
char line[80];
if( NULL != file ) {
fgets( line, 40, file );
fclose( file );
}
Is there anything dangerous in the above code, what i saw here was it got the maximum length 40 string to the buffer line then close the file.