| | |
IOS ::binary
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Solved Threads: 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
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
>>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.
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Pascal -> C++; Binary, convert? (C++)
- Writing to binary file, erases previous data? (C++)
- Error reading in file in binary mode (C++)
- Reading Binary files via stdin (C++)
- C++ raster files (writing structs to a binary file) (C++)
Other Threads in the C++ Forum
- Previous Thread: Expression same but different results why
- Next Thread: Addres problem
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






