944,162 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4553
  • C++ RSS
Dec 3rd, 2007
0

IOS ::binary

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sathishkumar.e is offline Offline
3 posts
since Nov 2007
Dec 3rd, 2007
0

Re: IOS ::binary

>>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.
Last edited by Ancient Dragon; Dec 3rd, 2007 at 8:19 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Expression same but different results why
Next Thread in C++ Forum Timeline: Addres problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC