Try this:
#include <fstream>
int main() {
ofstream out("test_append.txt",ios::app);
out << "This is a line of text." << endl;
out.close();
return (0);
}
Hsutaro
>From: "Alan Thomas" <ala...@3n...>
>Reply-To: dev...@li...
>To: <dev...@li...>
>Subject: [Dev-C++] appending to a file
>Date: Fri, 26 Jan 2001 22:08:32 -0500
>MIME-Version: 1.0
>
> I am trying to append to a file. However, the compiler gives
me
>the following error:
>
> 'ios_base'
undeclared
>(first use this function)
>
>The code is below. Any idea what I am doing wrong? Thanks, Alan
>
>#include <fstream>
>
>int main()
>{
> fstream append_file;
>
> append_file.open("test_append.txt", ios_base::app);
> append_file << "This is a line of text." << endl;
> append_file.close()
>
> return 0;
>}
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
|