I'm trying to create a file when i run my program. So say i want to create a file called hello.txt and put my output in it.
What code would i write so that it would create that file?
Thanks for any help,
...Dan
This is a discussion on Create a file from c++ program within the C++ Programming forums, part of the General Programming Boards category; I'm trying to create a file when i run my program. So say i want to create a file called ...
I'm trying to create a file when i run my program. So say i want to create a file called hello.txt and put my output in it.
What code would i write so that it would create that file?
Thanks for any help,
...Dan
This should explain how to do what you want
No No's:
fflush (stdin); gets (); void main ();
Goodies:
Example of fgets (); The FAQ, C/C++ Reference
My Gear:
OS - Windows XP
IDE - MS Visual C++ 2008 Express Edition
ASCII stupid question, get a stupid ANSI
Thanks I'll take a look at it