Hi everyone,
i am taking a beginner course in C++ programming but my course uses software in the windows environment.
I know this has come up many times, but i do appreciate if anyone could clarify things.
1.
I use Xcode.
Is the correct project to create called ( C++ Tool ) under the Command Line Utility?
2.
I have some basic code that works in windows but not on my mac.
This program copies the contents of a file and outputs a new file.
------------------------------------------------------------
#include <fstream>
#include <string>
int main()
{
ifstream infile("in");
ofstream outfile("out");
string s;
while (getline(infile,s))
outfile << s << endl;
return 0;
}
------------------------------------------------------------
Is something fundamentally wrong with my code? Or is it different on MAC?
Thanks a lot!
i am taking a beginner course in C++ programming but my course uses software in the windows environment.
I know this has come up many times, but i do appreciate if anyone could clarify things.
1.
I use Xcode.
Is the correct project to create called ( C++ Tool ) under the Command Line Utility?
2.
I have some basic code that works in windows but not on my mac.
This program copies the contents of a file and outputs a new file.
------------------------------------------------------------
#include <fstream>
#include <string>
int main()
{
ifstream infile("in");
ofstream outfile("out");
string s;
while (getline(infile,s))
outfile << s << endl;
return 0;
}
------------------------------------------------------------
Is something fundamentally wrong with my code? Or is it different on MAC?
Thanks a lot!