Static Data Member And Static Member Function In C++
HTML-код
- Опубликовано: 4 фев 2025
- JOIN ME
-----
RUclips 🎬 / @cppnuts
Patreon 🚀 / cppnuts
COMPLETE PLAYLIST
------------
C++ Tutorial For Beginners: • Introduction To C++
STL (Standard Template Library): • STL In C++
ThreadIng In C++: • Multithreading In C++
Data Structures: • Data Structure
Algorithms: • Binary Search
Design Patterns: • Factory Design Pattern...
Smart Pointers: • Smart Pointer In C++
C++14: • Digit Separator In C++
C++17: • std string_view in C++...
C++ All Type Casts: • static_cast In C++
INTERVIEW PLAYLIST
------------
C++ Interview Q&A: • Structural Padding & P...
C++ Interview Q&A For Experienced: • How delete[] Knows How...
Linked List Interview Questions: • Find Kth Node From Bac...
BST Interview Questions: • Search Element In Bina...
Array Interview Questions: • Reverse An Array
String Interview Questions: • Check String Is Palind...
Bit Manipulation Questions: • Find Set Bit In Intege...
Binary Tree Interview Question: • Invert Binary Tree
Sorting Algorithms: • Bubble Sort
C++ MCQ: • Video
C MCQ: • What printf returns af...
C Interview Questions: • Designated Initializat...
QUICK SHORT VIDEOS
-------------
C++ Short : • C++ Short Videos
C Short : • Shorts C Programming MCQ
In this video we will learn about "static data member and static member function" in c++ programming language.
There are few points about the same as follows:
1. We can define class members static using "static" keyword.
2. it can access only static data members. (non-static data member can be accessed but we have to pass the object inside function)
3. it can access private data of class.
#cpp #programming #tutorial #coding #cppprogramming #computerscience #softwareengineering
Your repetitive explanations are the best man ! I think that is the key for easy learning. I really understood what " static " mean now ! Thank you very much !
Thanks..
best and easiest explanation about the topic on youtube
you are really a real teacher
thank you so much please continue because we need more
Thanks dude..
This was an amazing video, I couldn’t find a simple video explaining static functions and variables. This helped me tremendously and I hope you continue to post videos like these
Glad it helped!
Finally understand the static keyword. Thanks! Great example.
Thanks
This channel Deserves More subscribers. Awesome Explaination.
Thanks dude..
Watched so many videos for static data member but finally i found this masterpiece 😌
Thanks..
Really amazing sir
Your all videos are best
Paid courses too don't have such quality and clear explanation!
Thanks 🙏🙇 a lot!
Thanks for the comment.
It means a lot.
Can u plz help me....why Thier is. Special declaration of y in needed outside the class I didn't get it
Thanks
Wow! That made it really clear! Thank you!
Really good. Best example to understand the static data member
Thanks man..
Superb Explanation Thanks👍❤
This video is really helpful. Thank you very much
you are one of the best out here in youtube
Thanks for the encouragement..
Can u plz help me....why Thier is. Special declaration of y in needed outside the class I didn't get it
Thanks
I totally agree, this guy is saving my college degree
Thanks Rupesh!
You are awesome, your explanation is toooooooooo good
Thank you so much 😀
Excellent Explanation Sir.
You're the G.O.A.T 🔥🔥🔥🔥🔥🔥🔥
Thanks bro.. as usual nice video... you are the best...
Can u plz help me....why Thier is. Special declaration of y in needed outside the class I didn't get it
Thanks
@@behindthescene4406 you mean for int Base::y; ??? or you need to do initialization for static member, in global scope, or else you will not be able to point it to same memory.
Thanks ..got it ..
Thank you for chopping into smaller details especially for me that is a slow learner.
Welcome dude .
Which ide are you using in above video?
Excellent sir
which compiler you are using? btw great video.
This is g++ and editor is sublime text 3
Great explanation sir, recently I face problem due to initializing static variable inside .h
very useful video, thank you. how do we ask specific questions? do you have any forum or blog? i came across some static function used by different cpp files using objects, so i was wondering why static function is used with objects. additionaly, evey c file is sending a different data to the function and function is declared as static inthe called c file.
Great explanation
Thanks..
Thanks buddy for this tutorial.. Please explain Static class also ??
We don't have static class in cpp.
Awesome thank you !
Thank u ....🙏🙏
keep going....
You are welcome!!
thankyou so much, these videos are really very helpfull :)
Glad you like them!
@@CppNuts keep growing :)
Very good video. Thank you....
You are welcome, thanks for the comment!!
what if we have pragma once in header file. In that case we can define static in header file ?
Sir , which ide u r usin ?
It is sublime text editor 3.
can we declare & initialize static variable in one place inside cpp class?
Int a=1;
Cout
Why do we need static data members and functions? I don't think we do, do we?
great video, thank you!
Thanks..
Hi CppNuts
How can we calculate number of classes in a hierarchy?
I have access only my class in the hierarchy.
Thanks
Irshad
Nice Video..
can you explain about internal linkage of static member function. I have some confusion.
And do static data member also have internal linkage??
Yes it is internal linkage.
internal linkage means other .cpp file will not access it even if file is included.
No if you have included the file then there is no question about becoz every thing will be copied there. And it will work like single cpp file.
Can u plz help me....why Thier is. Special declaration of y in needed outside the class I didn't get it
Thanks
In which memory static variable is stored?
Hey sir may I know what is meant by b1. X please
Thanks for this ...
What about static variables in functions? Do they act the same as class members.
Are we using Scope resolution for only defining static data members alone? Any other use is there?
scope resolution operator can be used for namespace, member function, to access global variables... etc so as you can see here its job is to resolve the scope that's why it is called scope resolution operator.
CppNuts thank you so much 👍😍
One question: If we can access static data member through non static method of class, then why there is need of static method in the class?
To do a common job for which no object is required.
Hello
Which IDE is are using??
Sublime text editor 3
Sir why static member function cannot be overloaded?
well done
Thanks..
#include
using namespace std;
class Base
{
public:
int x;
static int y;
static void showY(){ cout
You forgot to give memory to y.
Just put static int Base::y;
In global scope.
@@CppNuts Thanks alot
how can I watch the previuos video yu mentioned? please put link or give its name
What did i mentioned, it is very old video, and i don't have time to watch full video to find that line.
please let me know if i mentioned something and you remember.
what is use case of static member function?
Biggest use is you call them without any object of the class.
All fine but one thing you forgot mention, in which memory creating static variables
thanks man I will create separate video for that.
@@CppNuts where would it be ?
sir are you from india ?
Yes, i am from india, in india.
v nice
Thanks..
Sir clr nhi hai aap jab dusra step sikha raha ho
I can't see
Sir sirf aapna 10minute sikhaya voh pura clr tha baki pura blr hai