Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between ifstream::binary and ios::binary?

I've seen code written like so:

ifstream fin;
fin.open("largefile.dat", ifstream::binary | ifstream::in);

Now this makes me confused, is there any difference at all between the above code and this code below using ios::binary and ios::in as replacement?

ifstream fin;
fin.open("largefile.dat", ios::binary | ios::in);
like image 393
Andreas DM Avatar asked Jan 09 '23 08:01

Andreas DM


1 Answers

There's no difference. These names are inherited from the virtual base std::ios_base from which the concrete stream classes derive.

like image 164
David G Avatar answered Jan 30 '23 01:01

David G