file - Why is seekp not doing its job? C++/CLI -
my function "writetofile" writing piece of data file @ end of line indicated int variable zone. file set @ beginning text indicate put data, seekp() doesn't seem placing output marker need go. can point out i'm missing please? this file creation in main function: string myfilename = txtboxcont; myfilename.append(".txt"); myfilename="test.txt"; //temporary name, delete before publish <<. ofstream prefile(myfilename, ios::trunc); int i; (i=1;i<=4;i++) prefile << "dc" << << "\n"; prefile << "junk:"; prefile.flush(); prefile.close(); fstream myfile(myfilename,ios::in | ios::out | ios::ate); if (!myfile.is_open()) throw; and writetofile function: (fyi: data "0.95" or "623") void writetofile(fstream &myfile, string& data, int zone) { data = numbercheck(data); //filters out non-numeric data, returns "null" if nothing left. ...