ifstream - nocreate - how to?

G

Gernot Frisch

std::ifstream ifs(cFileMitExtdat, std::ios::nocreate);

gives:
error C2039: 'nocreate': Is not an element of
'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]




--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
 
W

William Payne

Gernot Frisch said:
std::ifstream ifs(cFileMitExtdat, std::ios::nocreate);

gives:
error C2039: 'nocreate': Is not an element of
'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]




--
-Gernot
int main(int argc, char** argv) {printf ("%silto%c%cf%cgl%ssic%ccom%c",
"ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com

nocreate is a non-standard, Microsoft-specific extention. But you won't be
needing it...ifstreams happen to be for reading only so the default
behaviour is not creating non-existent files.

/ WP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top