Why not class calling the main's function?
Ok guys I want your help in my programming assignment.
I have two files, main.cpp and a class file, i.e. mainMemory.h
I have programming struction like this.
////******My Function Definition Here************//////////(myFoo())
int main ()
No when my doSomething function in class is calling the myFoo() function defined in main.cpp it is not working and giving error? How can I call this function in class can anyone tell me?
Because class does not know about this function existence. You can forward declare it in mainMemory.h, but usually the need to call function outside class is indicator of bad program design.
Topic archived. No new replies allowed.