Why is there no ios::nocreate in linux? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is there no ios::nocreate in linux?

been trying to figure out a way around this. ios::nocreate throws a std error. is there a header im missing? fstream boesnt include it. anyone else have the same problem??

2nd Apr 2017, 5:51 PM
Michael Darnell
Michael Darnell - avatar
2 Answers
+ 3
It's because it's not part of standard C++. If all you're doing is reading a file, you don't need to include it anyway. ifstream objects won't create the file if it doesn't exist; this is the default behavior already.
2nd Apr 2017, 8:10 PM
Squidy
Squidy - avatar
+ 1
iOS::in checks to see if the file is there. she. I add iOS::out or app. that's when it creats a file
3rd Apr 2017, 3:33 PM
Michael Darnell
Michael Darnell - avatar