opening files

does anyone know how to open file in macbook air using code::blocks
because I'm having trouble opening files.

In the upper left corner is a button labled "File". Click on it and select "Open". ;-)
Seriously, we need more input to help you. What is your excact problem? Some lines of code would be useful.
Last edited on
Where are you placing the files you want to open?

They should be in the same directory as your executable file, assuming you're using unqualified file names.
the program needs to open a .txt file. i know how to open .txt file on a window using code::blocks but with a mac it's a bit different

1
2
3
4
5
6
7
8
ifstream fin;
    fin.open("H:MyPets.txt");
    if (fin.is_open())
    {

    }

OSX uses a Unix-like convention for file paths. This means that you use a forward slash '/' in between folder names instead of the escaped backslash '\\' that you do with MS UNC.
https://en.wikipedia.org/wiki/Path_(computing)#POSIX_pathname_definition
Topic archived. No new replies allowed.