marc maurer

Problems with fstream( )

Discussion created by marc maurer on Jun 22, 2009
Latest reply on Jun 23, 2009 by marc maurer

These days I've started to check out a few things about the C++ support of the CodeWarrior (V. 5.7.1844). I created a small C++ Project and I tried to get the following to run:

 

#include <iostream>
#include <fstream.h>

 

using namespace std;

void readFile()
{
    fstream inOut("test.txt", ios::in | ios::smileysurprised:ut);

}

 

I always get the Compile Error message: "Error: too many initializers" :smileysurprised:

 

If I remove the openemode flags it normally should compile,too , because there is a default parameter in the constructor, but this:


fstream inOut("text.txt");

 

delivers the compile error:

 "Error: implicit conversion from 'const char[9]' to 'std::basic_fstream<char, std::char_traits<char>>'

 

I have checked all the target settings and the include file contents, but i cannot find a solution to solve the compile errors.

 

Has anybody an idea ?

 

Thanks in Advance

mama

Outcomes