#include <stdlib.h>
|
|
void
abort (void); |
Any open streams are flushed and closed.
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
FILE *stream;
if( (stream = fopen( "notexist.file", "r" )) == NULL )
{
perror( "Error occurred while opening file" );
abort();
}
else
fclose( stream );
return 0;
}
Output
Error occurred while opening file: No such file or directory
|
© 2005-2007 Nokia |