home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
c
/
other
/
learn
/
wrfile.c
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1988-10-07
|
305 b
|
18 lines
/* WRFILE.C: Creates and writes to a disk file. */
#include <stdio.h>
main()
{
FILE *fp;
if( (fp = fopen( "c:\\testfile.asc","w" )) != NULL )
{
fputs( "Example string", fp );
fputc( '\n', fp );
fclose( fp );
}
else
printf( "error message\n" );
}