Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling of Member Function

Status
Not open for further replies.

raghu75

Programmer
Nov 21, 2000
66
IN
All,
I have a class with some member functions declared as public.Also i have one global function.i wanted to call some of the member functions of that class inside the global function.But I am getting errors in VC,
Any one can help me out
 
You must instanciate the class in your function and just call it through (.).
...func(...)
{
...
yourclass x;
...
x.classfunc(...);
...
} John Fill
1c.bmp


ivfmd@mail.md
 
On a side note... if it is an appropriate place for a static function you may look into that and call the fuction by

classname::functionName(...)

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top