Static member functions have no *this pointer
Static member functions have two interesting quirks worth noting. First, because static member functions are not attached to an object, they have no this pointer! This makes sense when you think about it -- the this pointer always points to the object that the member function is working on. Static member functions do not work on an object, so the this pointer is not needed.
Second, static member functions can directly access other static members (variables or functions), but not non-static members. This is because non-static members must belong to a class object, and static member functions have no class object to work with!
-
Notifications
You must be signed in to change notification settings - Fork 0
solareenlo/42Old-CPP_Module_00
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Old-CPP Module 00
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published