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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration problem-protected: static member func.-

Status
Not open for further replies.

ozgurgul

Programmer
Mar 15, 2004
4
EU
I have a protected static member func. in ,let's say class A, and I want to use it from another (B) class' non-static member func. What shall I do in both classes' header file? Should I use friend reserved?
If the problem and question is not well understandable, let me know!!!
Thanks for any advance...
 
Making it a friend should work. You might also ask yourself why class B needs to access a non-public function in class A. Should the function be public instead? or maybe you should move the function to a base class and have class A & B derive from that base class...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top