why cant i use fstream on mac

i have a stuff.txt file one the desktop

psuedo

#include<fstream>

ifstream in;
   ofstream out;


    in.open("stuff.txt");
    if(in.fail()){
        cout<<"failed";
    }

failing WHY???

Recommended Answers

All 2 Replies

Does stuff.txt exist in the same directory as the program? If not use a full path.

Does stuff.txt exist in the same directory as the program? If not use a full path.

thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.