C++ Static Variables and Members in Class | CPP Object Oriented Programming Video Tutorial

preview_player
Показать описание
In this c++ Object Oriented programming video tutorial, you will learn about the static variables or the static members.

You are gonna learn what are static variables, how to use them in functions, how to declare them in classes, how to initialize and use them in detail with example.

link for the next video tutorial on static member functions in classes

Learn Programming in HINDI at our youtube channel

Catch us on SocialMedia
Рекомендации по теме
Комментарии
Автор

Static memory is allocated during compile time not the run time. Only dynamic memory(Heap) can be allocated run time.

KashifAli-djnl
Автор

You're best man! I havent find any total c++ (advanced include)tutorial free on internet ! Thank you :)

degenerategambler
Автор

Thank you. A simple solution that could not be solved with hours of trawling through forums and C++ help pages.

huuhhhhhhh
Автор

Awsome..U cleared the concept in 9min which was in confusion for 2 hrs

sbnprajwalreddy
Автор

you are tutorials are helping me a lot.thank you so much sir 😊

Codeshub
Автор

you said static variables(counter is stored in heap memory), but in cpp static variables are stored in data segment of the memory right

PTeja-trqw
Автор

can we increment counter without creating a constructor?

saurabhkanva
Автор

Trust me this helped me to fix a bug...kudos

Sourabhgkulkarni
Автор

Static is created at compile time only so its not stored in heap segment it is stored in data segment

sreramvempati
Автор

Each time you access the static variable you will get the updated value of static variable. unlikely in stack the life your variable is not limited to the scope of that function, it remains there until you have the application memory available

KashifAli-djnl
Автор

Learning Led ... u r cool ... i liked all the videos of your's.
One thing if add ..that is
if u solve some problem based on all the concept and logic together and make some tutorials and add them at the end of the playlist will be the best :)

mdarefinsaad
Автор

Great video! So based on your two examples a static variable almost works like a global variable, except the static variable is in the heap and it does not require the programmer to manually delete the pointer?

KW-dgfs
Автор

oky but what is the useful of that static word i cannot understand?
would you help please ?

obadakhatib
Автор

In this static keyword
why scope resolution human_count=0 runs first?

shabbirali
Автор

hey where is the code used in these lectures?? please paste the exact link bot your website name ..

vinodkumar-imxy
Автор

I tried to find where is your tutorial video about array object ?

khunta
Автор

Oh my gosh that's so simple...why couldn't I figure it out myself? xd

lephobix
Автор

initialisation of the static member is not necessary outside the class however definition is (as it is static therefore it automatically gets the initial value 0 even while it is defined (only)outside the class ).

nitikadhiman
Автор

Does not the unintialised static variables will be initialised to zero by default.
But my doubt is why we are not able to initialise the static variables inside the class itself.
what prevents us from doing so..and why does it prevents us.???

monishkumardurairaj
Автор

counter will not be stored in heap, as it is static it'll be stored in data section of PCB

sachinbagalakoti