This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: GCC3 problems with C++ fstream
- From: Ney André de Mello Zunino <zunino at unu dot edu>
- To: cygwin at cygwin dot com
- Date: Tue, 13 Aug 2002 02:12:24 +0900
- Subject: Re: GCC3 problems with C++ fstream
- Organization: UNU Campus Computing Centre
- References: <187198960129.20020812184802@familiehaase.de>
Gerrit P. Haase wrote:
#include <fstream>
void main() //the program starts here
main() must return 'int'
{
ofstream SaveFile("cygwin.txt");
ofstream lives in the 'std' namespace
SaveFile << "Hello World, this works with gcc-2 but not with gcc-3!";
SaveFile.close();
}
Try this corrected version:
#include <fstream>
int main()
{
using namespace std;
ofstream saveFile("test.txt");
saveFile << "Hello World, this works with gcc-2 but not with gcc-3!";
saveFile.close();
return 0;
}
Hope this helps,
--
Ney André de Mello Zunino
Media and Technology Laboratory
Campus Computing Centre
United Nations University
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/