Hey I'm not able to write to file in Xcode 4.0 with c++
I'm completely new to both Xcode and C++. But it seems to me
like it might be some settings that I have wrong.
When I'm writing stuff to be prompted it works fine, but I can't get
Xcode to give me an output. Can you help me?
Simple code:
This compiles, but there is no output.
I'm completely new to both Xcode and C++. But it seems to me
like it might be some settings that I have wrong.
When I'm writing stuff to be prompted it works fine, but I can't get
Xcode to give me an output. Can you help me?
Simple code:
Code:
#include <fstream.h>
int main () {
ofstream examplefile ("test.txt");
if (examplefile.is_open())
{
examplefile << "This is a line.\n";
examplefile << "This is another line.\n";
examplefile.close();
}
return 0;
}
This compiles, but there is no output.
Last edited by a moderator: