Page 1 of 1

What function do i use to create a new file?

Posted: Sun Nov 24, 2002 8:31 am
by Rob_Beard
Hey all,

What function do i use to create a new file? All i can find is opening files, and saving to already created files?

...

Posted: Sun Nov 24, 2002 9:45 am
by QWERTY

Code: Select all

fopen( "my_file.txt", "w" );

Manual (fopen()):

'w' - Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.