I'm trying to output data to a .csv
file, but when I run the program it does not change the output file. It is as if I have not run the program at all. It builds successfully.
I created this project in XCode. The ".xcodeproject"
and "example.csv"
files are located in the working directory (Desktop -> ofstream). "main.cpp"
is located in Desktop -> ofstream -> ofstream and is the only file in that folder. I am using "Release" for builds.
#include <iostream>
#include <fstream>
int main( int argc, char* argv[] )
{
std::ofstream myfile;
myfile.open ("example.csv");
myfile << "This is the first cell in the first column.\n";
myfile << "a,b,c,\n";
myfile << "c,s,v,\n";
myfile << "1,2,3.456\n";
myfile << "semi;colon";
myfile.close();
return 0;
}
What am I missing to successfully write into this .csv
file?