• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Passing/Using fstream to/in Class - OOP

kuphryn

Senior member
I can easily call the fstream class within main(). However, I cannot pass the instance of fstream into another class. Furthermore, I tried #include fstream in the class member function file. That does not work either. Is there a way to pass and/or use fstream in a class?

This is out of topic, but for example let say I declare a pointer as:

char *pointer;
pointer = new char[5]; // Notice this pointer is one dimensional

When passing it to a function, is it possible to also declare the function as a pointer to that pointer?

Ex:

void right(char **ptr)
{}

Will ptr point to pointer?

I do know that "char **ptr" will work if it is pointed to "*pointer[]." The problem is "*pointer" is one dimensional, not two.

Kuphryn
 
Back
Top