![]() |
this pointer and static member functions
Hello freinds ,
Can you please tell me why this pointer cannot be used on static member functions. "`this' is unavailable for static member functions" Regards, Faizan |
Re: this pointer and static member functions
Syntactically
this pointer is not available in the static function because compiler does not pass the this pointer into the static functions.Now semantically the concept is static functions can be called before the creation of object and also independent of the object and so this object is not created and so its not available. I hope its clear now or else :shoot: more questions. |
Re: this pointer and static member functions
Thanks for the Reply,
I just want to add STATIC FUNCTIONS and Members dont have Class Scope, as they have static storage . where as non static members and functions have class scope thats why "this" pointer is available to non static class members. Regards, Faizan. |
Re: this pointer and static member functions
you mean Static method don't have class scope?????
Quote:
|
| All times are GMT +5.5. The time now is 03:46. |