Message-ID: <364E3F13.8CEE8402@videotron.ca> From: Dac Chartrand X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: fr,en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Better way of modyfing file contents in C++ [DJGPP]? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 73 Date: Sat, 14 Nov 1998 21:40:19 -0500 NNTP-Posting-Host: 207.253.0.181 X-Complaints-To: abuse AT videotron DOT net X-Trace: weber.videotron.net 911097376 207.253.0.181 (Sat, 14 Nov 1998 21:36:16 EDT) NNTP-Posting-Date: Sat, 14 Nov 1998 21:36:16 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Please respond to sender and newsgroup, Thanks. Hi, I'm using DJGPP and I was wondering if there was a more efficient way to append information and delete information from a simple txt file then my following method: /* cheap method of adding user to access.dat by using a temp file instead of ofstream library which didn't seem to work for me. */ while(1) { ifstream fin("access.dat"); ofstream fout("temp.dat"); while (fin >> UserNameFileValue >> UserPasswordFileValue) { fout << UserNameFileValue << " " <> UserNameFileValue >> UserPasswordFileValue) { if (GivenUserName != UserNameFileValue) { fout << UserNameFileValue << " " <