-
ios::nocreate
Help wanted !
What wrong with the following code
file.open(pFileName, ios::in | ios::nocreate);
When compiling, the compiler have an error of "nocreate is not a member in ios" .
I do not know what wrong with the code on ios::nocreate.
When using MS C++ compiling
I can replace the code with
file.open(pFileName, ios::in | 0x40);
It can be compiled with no error. But using dev C++, it cannot.
Thank you
lshome
-
Iv'e had to deal with this recently as well. Include <ios.h> and this will go away. Kinda stupid in my opinion to need to include this file just to be able to use nocreate, after all, you don't need it for ios::in or ios::out but suddenly try and use ios::nocreate and the compiler flakes out on you. Sheesh!
[edit]Wait a minute, this fix was for MSVC++ 6.0 I don't know if it will work using that other compiler.[/edit]
-
ios::nocreate doesn't exist anymore. If you have an up-to-date standards-compliant compiler, it will not find it. Check out this thread: http://cboard.cprogramming.com/showt...light=nocreate