Classes Part 32 - static member variables and functions in classes - Modern Cpp Series Ep. 70

preview_player
Показать описание

►Lesson Description: In this lesson I show you how to use static within a class. The static keyword used with member variables in a class limits their scope to 'class scope'. Effectively, the variables are working the same as with static in our other example, just that they are available from a class scope, and not tied to a specific instance of a class. Static member functions are similar in that they are not tied to a specific instance of a class, and can otherwise only make use of static member functions in their body (i.e. they cannot use 'this' within the static member function).

►Please like and subscribe to help the channel!
Рекомендации по теме
Комментарии
Автор

Just dropping in to say thank you for the awesome content. 100+ more videos to go!

RomanTimm
Автор

Exceptionally great lessons, as always. Thank you, sir!

Sergei_developer
Автор

Thanks Mike. Always love the C++ content.

dwolrdcojp
Автор

nicely done - esp showing how to actually do the files.

agnichatian
Автор

Great video. Very wonderfully explained as always. Thank you.

dhanushs
Автор

Hi Mike, great stuff. So well done with great pictorial explanation .
what is an API? in layman's terms. The term has always caused confusion to me.
i so love your answer to Klutch comment : the adventure continues Forwards and ownwards!

blaisofotso
Автор

So is a static pointer stored in the program, but the memory it's pointing to would be on the heap? (if allocated with new)

Chimponaut
Автор

Could you illustrate does it mean that static is allocated with binary? Google just told me that it is stored in somewhere called data segment

kafuu