0

Hi, Im trying to write to specific points in a file, but the write() erases everything in the document..heres what im doing:
the file:

mode 0 ;
level 0 ;
menu 1 ;

the code:

ofstream data_w_fil;
	data_w_fil.open("data.gsp");

	data_w_fil.seekp(7);
	data_w_fil.write(mode, 1);
	data_w_fil.seekp(18);
	data_w_fil.write(level,1);
	data_w_fil.seekp(28);
	data_w_fil.write(menu, 1);

Whats going on?

Heres the result :
the file:

0          0         1
1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Icebone1000
This question has already been answered. 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.