0

Hi to all,

I'm a newbie to C++,i have a doubt in the ofstream write function.
I have a code like this
ofstream* rgpostrm [BASE_LAYER];

rgpostrm [BASE_LAYER] = new ofstream (pchCmp, ios::binary | ios:ut);
and some write function like
rgpostrm[ENHN_LAYER]->write(rgpvoenc [ENHN_LAYER]->pOutStream () str(),
rgpvoenc [ENHN_LAYER]->pOutStream () ->pcount ());

where the pchCmp is a string pointer points to the output file path.
I googled and found some related topics which has
1)
ofstream outfile ("new.txt",ofstream::binary);
outfile.write (buffer,size);
2)
ofstream out("test", ios:ut | ios::binary);

My question is whether my code has the same property of writing the buffer content of size n in the output file.
What it says for ios::binary | ios:ut and ios:ut | ios::binary

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

>>ofstream* rgpostrm [BASE_LAYER];
Why do you need to many streams? And why allocate them ?

>>What it says for ios::binary | ios:out and ios:out | ios::binary
There is no difference between the two. Its like asking what's the difference between 2 times 3 and 3 times 2.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.