i learning c++ @ school, have mac , started using xcode. use fstream library.
need know ".out" file located or how create it.
managed create input file , if use "cout" display result works. hope explained well, here basic program show mean:
#include <fstream>
using namespace std;
int main()
{
int a,b;
ifstream in("test.in");
ofstream out("test.out");
in>>a>>b;
out<<"a+b= "<<a+b;
}
your code creates output file. in case, created in folder run program. if running within xcode, can set working directory, or use default. i'm not sure default location is.
Forums Macs Mac Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment