Search:
Forum
Beginners
opening files
opening files
Mar 4, 2016 at 5:59pm UTC
axel609
(48)
does anyone know how to open file in macbook air using code::blocks
because I'm having trouble opening files.
Mar 4, 2016 at 6:57pm UTC
AlphaFoxAlpha
(8)
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
Mar 4, 2016 at 6:57pm UTC
Mar 4, 2016 at 7:15pm UTC
AbstractionAnon
(6954)
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.
Mar 4, 2016 at 8:20pm UTC
axel609
(48)
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()) { }
Mar 4, 2016 at 9:44pm UTC
Computergeek01
(5613)
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.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs