home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_06
/
8n06024a
< prev
next >
Wrap
Text File
|
1990-04-18
|
405b
|
28 lines
*****Listing 1*****
#include <stdio.h>
#include <stdlib.h>
main()
{
FILE *out, *tmp;
char ch;
printf("Enter A (abort), E (exit): ");
ch = getchar();
tmp = tmpfile();
fwrite("abcdefgh\n", 1, 9, tmp);
out = fopen("TEST.DAT", "w");
fprintf(out, "message to data file\n");
fprintf(stderr, "error message to stderr\n");
if (ch == 'A')
abort();
else
exit(0);
}