Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving to text file.

Status
Not open for further replies.

felixsoft

Programmer
Nov 8, 2001
15
0
0
US
I am writing a dictionary number generator in c++ and i am currently using system("write.exe >> dict.txt");
but when i run the program i get this

(copyright stuff)
file creation error.
1
2
3
4
5
etc.

is there a more professional and reliable way to pipe everything on the screen to a text file? If so how. Also... how can i close running programs using c/c++. This one is for my pic1324.exe virus cleaner.
 
command line argument for the file name could be a possibility. iostreams or good ol' fputs :). If you are taking the time to have the program output, you could just replace the way you are outputing with the afformentioned ways.

matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top