Hi
can I declare an ofstream in a class declaration in .h file and define
it inside a method in the .cpp file? if so, what does the syntax of
defining it looks like.
I tried
....
ofstream out; // in .h file
and
myclass::myfun(){
....
string s = "some.file";
out(s.c_str()); //in .cpp file
....
on the line above, I get
error: no match for call to '(std::ofstream) (const char*)'
so that another method uses it
myclass::myotherfun(){
out << ...
thanks