UnknownPerson
Programmer
Someone please help:
In one of my coding works, I needed a class wich manipulated records on a file. As such, I made a ostream member as in:
class SomeClass {
ostream 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!!!!
ostream 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.
In one of my coding works, I needed a class wich manipulated records on a file. As such, I made a ostream member as in:
class SomeClass {
ostream 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!!!!
ostream 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.