Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why can't ios::ate and seep(0, ios::end) in open() cannot serve like..

Status
Not open for further replies.

hughLg

Programmer
Feb 18, 2002
136
0
0
MY
Code:
outF.open("file.dat", ios::out | ios::binary | ios::ate);
	//outF.seekp(0, ios::end);
	outF.write((const char *)&num, sizeof(num));
	num = 3;
	outF.write((const char *)&num, sizeof(num));
	outF.close();

Why the open("file.dat", ios::eek:ut | ios::binary | ios::ate) and seekp(..) cannot make the append operation success?

It always write from the start of the file! Yes, I know it can easily be done with ios::app in open function, but why?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top