I was checking through the tutorials (again), and I got to lesson #10 where it says:
The thing is that this doesn't create a file called "example.txt" anywhere...Code:#include <fstream.h> #include <iostream.h> int main() { char str[10]; //Used later ofstream a_file("example.txt"); //Creates an instance of ofstream, and opens example.txt a_file<<"This text will now be inside of example.txt"; //Outputs to example.txt through a_file a_file.close(); //Closes up the file ifstream b_file("example.txt"); //Opens for reading the file b_file>>str; //Reads one string from the file cout<<str; //Should output 'this' b_file.close(); //Do not forget this! }
Is it just my comp, or what?



LinkBack URL
About LinkBacks


