Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot use ofstream members

Status
Not open for further replies.

UnknownPerson

Programmer
Dec 4, 2001
80
BR
Someone please help:

In one of my coding works, I needed a class wich outputed records on a file. As such, I made a ofstream member as in:

class SomeClass {
ofstream TheFile;
};

To my surprise, any attemp to TheFile.open(....) fails, no matter what the parameters. Anyone have a clue?. I made the following test:

SomeClass::OpenSomeFile(std::string& Name)
{
TheFile.open(Name.c_str()); // FAILS!!!!
ofstream SomeOtheFile(Name.c_str()); // Works perfectly
}

Any ideas???

Notes: Using MSVC++ v5.0 Enterprise. I sent this message to 3 different C++ related discussion rooms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top