How can i use a global function in a class?
How can i use a global function in a class?
And how can i use function pointer to point a global function in a class?
Thanks
What do u mean a global function, do u mean one defined in another class or part of the program away from ur code. If u mean a function defined in your class then u just give the name for example
suppose the class Test exists
has for pointers to functions I cannot really remember how to do that
Hope I have helped in anyway
calling a function from another class or ur main program with your function, I dont really know how try calling it the normal way by including the header of the source file it exists in
Dark Star
UK
suppose the class Test exists
void Test::function (){ // call another function in my class Test Test::function2(); // or call it by this function2(); // or by ''this'' this->function2();}
has for pointers to functions I cannot really remember how to do that
Hope I have helped in anyway
calling a function from another class or ur main program with your function, I dont really know how try calling it the normal way by including the header of the source file it exists in
Dark Star
UK
Global functions can be called from everywhere, you just need to include the file where the prototype is defined
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement