specifically this type of file i/o:
ifstream aFile ("blah", ios::binary)
i don't actually have linux and i know nothing about it and can't test it, i just want to leave the option open in the future to port my program to linux.
specifically this type of file i/o:
ifstream aFile ("blah", ios::binary)
i don't actually have linux and i know nothing about it and can't test it, i just want to leave the option open in the future to port my program to linux.
Yes, you can use ifstream in linux. At work I had a problem using ios::binary on Unix, since all files are treated as binary. I assume you may find the same problem. Use a conditional define to test for the operating system, eg :
Code:#ifdef _LINUX_ ifstream aFile ("blah"); #else ifstream aFile ("blah", ios::binary); #endif
why not just use the C defined file streams?
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
... The obvious answer: Maybe he's programming in C++.Originally posted by Lynux-Penguin
why not just use the C defined file streams?