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