I don't know about the second part, but to write to a text file...
Note that this (I think) only works in C++, not C.Code:#include <fstream.h> int main() { ofstream out("myfile.txt"); out << "test" << endl; out << "another line"; // close the file here, but I forgot how return 0; }




Reply With Quote