Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Objects/StaticMembers/StaticMemberFunctions

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Most member functions conceptually manipulate one specific object, but a member function marked by the static keyword is for computation that is collectively about all objects of that class. The compiler doesn't provide any this pointer to a static-member-function, so a static-member-function can only access static-data-members. Whereas an ordinary member function is invoked on a specific object (oObject.DoAction()), any code may invoke a static-member-function without having any object (simply calling CRType::DoAction()). Additional information about static-member-functions