This Pointer | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

This Pointer

can we use this pointer with static functions? would you please give a brief description. thank you!

21st May 2018, 5:12 AM
Zohaib šŸ‘‘
Zohaib šŸ‘‘ - avatar
1 Resposta
+ 3
No... This pointer is passed in hidden way by compiler to your class methods (non-static) and it is a constant pointer to current caller object (object on which you call method)... because of this, static class functions (that dont belong to an object) dont get need of this pointer
21st May 2018, 8:14 AM
KrOW
KrOW - avatar