Static Data Members in C++ & Static Member Functions in C++|C++ programming tutorials for Beginners

preview_player
Показать описание
Support Simple Snippets by Donations -
--------------------------------------------------------------------------------------------- In this video tutorial we will understand the concept of static data members in c++ and static member functions in c++.

Static Data members in C++_
A static member is shared by all objects of the class.
All static data is initialized to zero when the first object is created, if no other initialization is present.
We can't put it in the class definition but it can be initialized outside the class using the scope resolution operator :: to identify which class it belongs to.
When we declare a member of a class as static it means no matter how many objects of the class are created, there is only one copy of the static member.

Static Member functions in C++
By declaring a member function as static, you make it independent of any particular object of the class. A static member function can be called even if no objects of the class exist and the static functions are accessed using only the class name and the scope resolution operator (::)
A static member function can only access static data member, other static member functions and any other functions from outside the class.
Static member functions have a class scope and they do not have access to the this pointer of the class.
You could use a static member function to determine whether some objects of the class have been created or not.

Simple Snippets Official Website -
Simple Snippets on Facebook-
Simple Snippets on Instagram-
Simple Snippets Google Plus Page-
Simple Snippets email ID-

UpSkill is an Ed-Tech Company / Coaching Centre for Information Technology / Computer Science oriented courses and offer coacing for various Degree courses like BSc.IT, BSc.CS, BCA, MSc.IT, MSc.CS, MCA etc.

Contact via email /call / FB /Whatsapp for more info

We also Provide Certification courses like -
Android Development
Web Development
Java Developer Course
.NET Developer Course
Check us out on Social media platforms like Facebook, Instagram, Google etc
Рекомендации по теме
Комментарии
Автор

Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

SimpleSnippets
Автор

Sir you are truly the best 6 years later and you are still one of the best c++ channels ❤

Nemesis
Автор

Very young and experienced teacher...🙃🙃🙃

Selva-bxiy
Автор

Such an amazing lecture...u deserve so much subs dude ..ur great man!!

Sammie
Автор

your video is embedded in Chandigarh University course material, Kudos!

tekina
Автор

Jenny's lectures and simple snippets ❤️❤️ONE OF THE WAY TO LEARN AND UNDERSTAND CONCEPTS ❤️

shreyasachar
Автор

nice explanation of the concept, thanks

rashminirmale
Автор

You are helping very much to many students

satishkanakappanavar
Автор

very informative and well explained .. Thanks Simple Snippets 👍❤

spraygodgamer
Автор

your videos were really helpful for my practical exam on one day before thanks

omkale
Автор

I found no particular reason for using the integer variable x in the static data member program.
Anyways Thank You.

vijaysinghchauhan
Автор

bhai khatarnak ho yrr tum to, keep it up bro

YogeshSingh-ic
Автор

Can u give an example of static data members and member functions without using constructors

shubhasriallam
Автор

Ur way of explaining is awesome and really helpful.. Keep uploading more such videos..

mansijain
Автор

You are awesome you are great!! And the thing you are doing is very kind from.your side really man I easily understood this!!!

adityamahesh
Автор

I watch this video 2 times, now I understand very well, all my doubts have cleared, Thank you so much

malikasingal
Автор

this video clarified almost all my doubts and was really helpful. so thank you .

kalashjain
Автор

What will happen if we initialize(3:24) "int myclass::count;"

nidhinhari
Автор

Is there any need of declaring the int x in the program..? Because I did not find a reason to declare it...can you pls explain?

aarjavbaxi
Автор

ayyy simple snippet bahut achha kaam karta hai re tum

akashwagh