Sunday, July 12, 2009

HELP!!! C++ PROBLEM! Someone Please HELP!?

first of all, who ever can help me with this...thanks in advance...


ok so my problem is that i am supposed to write a header/cpp file that inherits from the ifstream class and i am supposed to overload the constructor such at instead of using .c_str() each time i can just use std::string. Does anyone know how to accomplist this? I have no clue where to start or what i am doing. Any help on this is greately appreciated. Please. Thanks.

HELP!!! C++ PROBLEM! Someone Please HELP!?
Your question is kind of confusing, because there's no obvious need to use .c_str in a contructor that takes a std::string. The way I'd define such a constructor is like this:





myclass::myclass(const std::string %26amp;str) : ifstream(str) {


}


No comments:

Post a Comment