--- On Sun, 11/9/08, crystalcat_75 <[EMAIL PROTECTED]> wrote:
From: crystalcat_75 <[EMAIL PROTECTED]> Subject: [c-prog] Editing a word in text file in C++ To: [email protected] Date: Sunday, November 9, 2008, 4:54 AM I want to use the following program for replacing the first character in the file name with "w" its not working please help...... #include<iostream. h> #include<fstream. h> #include<conio. h> main() { clrscr(); ofstream outf; outf.open("D: \\cat\\normal. txt",ios: :ate|ios: :in|ios:: out); outf<<"w"<<endl; outf.close() ; getch(); } Your opening the file and setting the file pointer to the end of the file when using the mode "ate" Use "outf.seekp (beg);" to set the file pointer to the beginning of the file. Mickey M. Construction Partner Inc. http://www.constructionpartner.com [Non-text portions of this message have been removed]
