how do i read and write a file. Any sample code or tutorial web site would be greatly appreciated.
how do i read and write a file. Any sample code or tutorial web site would be greatly appreciated.
Code:ofstream WriteFile; WriteFile.open("TestFile.txt", ios::out); if(!WriteFile.fail()) { WriteFile << "Hello text-file!"; WriteFile.close(); }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
>if(!WriteFile.fail())
I personally prefer to be more explicit in the test I want:
if ( WriteFile.is_open() )
-Prelude
My best code is written with the delete key.
there is a good tutorial at www.cpp-home.com in tutorials sectinon
C++ Makes you Feel Better
"Gravity connot be held reponsible for people falling in love"--Albert Einstein