Static Data Members & Methods in C++ OOPS | C++ Tutorials for Beginners #24
Vložit
- čas přidán 1. 03. 2020
- ►Source Code & Resources: codewithharry.com/videos/cpp-...
►This video is a part of my C++ playlist: • C++ Tutorials In Hindi
►For Doubt Solving, Brain Storming Sessions & guaranteed replies, join the channel membership here: / @codewithharry
►Click here to subscribe - / @codewithharry
►Checkout my English channel here: / programmingwithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithharry.com
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
Static local variable = class variables
Visibility: class
Lifetime: till termination of program
Default value:0
Storage:heap
Local Variable
Visibility: class
Lifetime: until execution of class
Default value:garbage
Storage:stack
Global variable
Visibility: file
Lifetime: till termination of program
Default value:0
Storage:heap
thanks bro
Sooo much thanks bro
Thanks bro
🎉
11:52
Two properties of static functions are:
1> They can access static data members only
2> They can run without making any object for the class
Edit the first one : add "only " after access
@@hwaiting3573 Thanks
@@AshutoshKumar-fu6qe No problem
👍👍
absolutely correct 👍👍
I watch till very end to listen to the music. It's satisfying a lot.
Same here bro 🤣
😂same here
Same lol
You can directly skip the video till end, don't waste your time
Bhaiya data structures and algorithms pe bhi banado please, specially for competitive programming. Thanks a lot for your C and web development course, I learnt a lot from those
Bhai yar muje kuch smaj nahi aara h 😭 opps se please help kro 😭
DS and algorithms pe bhi banao please
@@dheerajaggarwal606 College mai ho ya nahi? Mujhe bhi difficulty ho rahi hai thodi si is topic pe.
@@silverpenetrator739 hu 😭
@@dheerajaggarwal606 mujhe bhi nhi aa rha tha, fir maine Stephen Simon's ka oops in c++ in one video wala video dekha, waha se thoda basics clear kiya, fir geeksforgeeks pe jake thoda padha uske baad firse video number 21 is playlist ki start ki(is baar 2x pe dekha) , ab mujhe samajh aane laga hai, tum bhi try kar sakte ho, 1-2 din lagega max ye sab karne me.
This is very helpful course I like it. I just want to add one point in this, I saw ur c course, like this u can provide some small small exercise during this course. It's just for logic building. Otherwise overall it's great. I am learning so many things from you. Thank you.
OK Agli baar se ho jaega sayad
@@manishkasera8584 ho gya kya ?
Static data members are used to see the no of objects created and if the value is sequential then we came to know that.. Yes a common value is being shared and no of objects is returned. Static member functions are used to check the no of objects via static data members and also we can check whether the objects are created or not.
Thnx Harry sir.
so grateful to you sir for these videos.
Every videos are awsm great help to my future Thank you so much👌👌👌👌👌
i came from udemy and i didnt understand oops there and then I saw your videos . now every topic is cemented . thanks for the good work;
Udumy me Abdul Baari sir kaisa padhte he c++?
bro didn't lose the habbit to use semicolon;
Great Video sir
Really helpful
Harry bhai please put the question content also just like in C course
Thank you Harry Bhai. This is very helpful for me.
thank you so much sir ji.
Thank you so much Harry bhai for making this video 🌹☺️
Thanks Harry bhai!😊
Thank You 🙏🏻
great work sir...Thanks for the video.. Harry bhai
This playlist is very helpful
Videos Number #23
31-12-2022
05 : 57 PM
// Array in class
#include
using namespace std;
class Student
{
private:
int RollNo[10];
int Marks[10];
int n;
public:
void getData(void);
void Display(void);
void Count(void)
{
cout n;
}
};
void Student ::getData(void)
{
Count();
for (int i = 0; i < n; i++)
{
cout
The course is really amazing , I am starting this course after learning python , for starting DSA in c++. The only thing that is missing in the course are exercises. But thankyou again for such an amazing course.
hey even I started c++ and about to start DSA would you like to group study with me online?
post jee?
@@tanishbajaj4952 what?
@@chiragparmar1964 i am in , where can i contact you
@@chiragparmar1964 nei degi bhai...
Thanks aap bahot acche videos banate hai
Harry bhai your videos series is outstanding
Thanks Harry Bhaiya
Sir you are doing grear job
Very good explain sir
ahhh Thank you, Harry bhai!
1:17 Static data member
11:09 Static member function
Thanks sir your all video is very helpful
very useful content and easy to understand
Sir apka samjhane ka tarika best hai
Thank you bhaiya❤️
SIr aap tier 3 collage students ka bhavan ho🙏🙏🙏 Thanks for your effort to change Indian education system i always share your playlist to all my friends
dhanayawad harry bhiya
Thankyou sir ji
Thank you bhai :) :)
Thanks
bro amaazzzziiiing course!!!!!!!
Thank you sir
Really learned a lot
Thank you
cout
awesome tutorial sir
Can u extend machine learning tutorial by explaining swarm intelligence ,ant colony algorithm??
I waiting this video 😀😀
thank you so much bro
Greatt!!!👍👍👍
Hey harry,
This playlist is too confusing even though I have completed your c language course because of too lengthy programs as an example also you made written notes for c it was so useful for me during exams for concept learning....🧡🧡🧡
yep you are exactly right.....He uses very tough example for code to understand us...but these tough examples create very confusions
Thankyou Harry Bhaiya
thank you harry bhai
soo, nice harry bhai
Awesome video😎😎👍👍
sir apka video dek kar 90% clear hota hai , orr baki 10% joki question reheta hai jiska ans nehi milta
Thanks bhai
Sir, please add some questions between the video because I am beginner and don't have any experience that how to approach questions...
thanks harry bro
ending music is awesome harry bhai you are one of the peoples who are changing the future love from pakistan
Harry Bhaiya you teahing is osm...
The only loophole is the videos are too short , with not very much examples/exercises :)
Thank youuuuu
2 properties of static function are
1. they run without objects, with the class name and resolution operator
2. they can access static data members, only
they can access static data functions too bro
Thanks a ton Harry for such an informative video. I have two questions on this video.
1. Why is it required to declare the static variable outside of the class with scope resolution operator and inside to specify its static property ? Can't we do it in one go.
2. Why static functions can only access static members of the class ?
1. I think to allot memory beforehand (not sure about this one)
2. Because other member functions (say int id) are property of object, i.e. they will have different values for each object. ( like id of harry is 1, rohan is 2 ...)
Q2 ans: because static functions are props of class not object.
They are shared by class. So it just can access static members (also class property)
Thnx Harry sir
Write a program to add two vectors. A vector in 3D can be represented as v=ai+bj+ck. The
initial value when a vector is created will be 0i+0j+0k. Use the name of class as vector. There will
be three functions one for input, for sum and for display.
Sir .....
ans>
Jaise complex ka kiya tha waise he isko bhi karna hai
They both are similar
Static variable ~ class variables
Static functions do not need any object to run
Static functions can access only static variables
Harry bhai you are the best❤️
I just got essence of it after changing variable to 1000!
Datastructure and algorithm
Static variables are class variables.
Every object of class have its own copy of variables but im case of static variables... Value of static variable is not different for different objects.
absolutely right my dear.hv u completed your cpp learning?
@@md_asharaf tharki bc xD
Hey pls make a playlist on ethical hackimg course
Yes, Do!
+++
nice
Summary on 14:52
Sir aapne itni mehnat ki hai ,sir thodi or mehnat karke sir aapko Ed do question karvane chahiye the
Sir i tried a new thing if you will not initialize count with 0 then, by simply writing it as (int count; ) then it will also work....
sir?
Will you be adding the videos on STL in c++ in this playlist?
kr dega to chaar chand lg jaega
@@manishkasera8584 kr diya add
Data structures or algorithms pe bhi video banao bhaiya
Ek game development pr bhi playlist bna dijye sir....Please
Do we use static variable only in class?
HEY how to get object name in runtime?
Why static function allows itself to define it inside of class but static datatype doesn't?
sir aap har video k sath notes available kra dete to kafi accha rehta kuki aap ki kahi sari batein nhi note kr pata hu
Notes discription mai hote hai bro
In my college I have to face huge problem of language because all the lectures are taken in Gujarati language
This man help me
Analytic way mein samjhao please
Harry bhai ham n dimensional vector kaise bana sakte hae cpp me
But if we run setdata on harry again the count will change. And in this way we may have a logical error as the number of objects is remaining the same rather we r using the method again on some previous object to change the ID but i will again change the count as well and the count will be greater than the objects ....
cfbr good stuff
it is too confusing
Confusing nhi interesting ek baar samajhke dekho bhai .....mujhe tumpe vishwaas hai tum kar sakte ho....jee jaan laga do and Jeet jao iss baar
@@harshhitgupta4434 yeah its interesting. And I suggest to watch c before c ++ bcz its kind of cakewalk after learning c😊
Harry bhai django ke follow unfollow models par bhi video bna do
Can we use global in this instead of static
Sir please ap hamain har video ke sath koi practice task bhi de diya karain .....! thanks
Harry bhaiya ...kya dynamic memory allocation yahi hai??
5:09 x static vatiable को आप क्लास के अंदर नही बाहर लिख सकते है। 5:54 में फिर से static int count class के अंदर ही लिखा।
Declare andar karna hota ha
Bahar likh ka usa memeory milti ha mtlb memory allocate hoti ha
Aur initialise bhi bahar karni padti ha ,
Scope resolution operator kis video mn explain kia hua hai?
Sir app samjate to accha ho per notes banane me problem ho Rahi hai app sab mix kar dete ho kuch bhi baad me samaj nahi atta
6:30 have to declare ststic variables outside of class
these are by default initialized at 0
this comment is just for my referance.
CZcams will strike you for guidelines you are using comment section for personal purpose.
sir agar hum int count ko globally declare kare means after namespace std then also its showing the same result....when we used static variable.?
If you would do that then basic meaning of encapsulation is gone, the properties and methods of a particular function should reside inside the same class.
Here count is property of class so it should only be accessible to class not to the entire codebase.
7:57 ohh ab samajh aaya static ka fayeda hai default value zero hogi isliye bina set kiye correct numbering milegi aur static use na kiya aur fir set kiye bina chalayenge to garbage value milegi
Bhai plzz atock market ki algorithms banane ki series bana do plzz plzz bhai request kubool kro 🙏🙏🙏
❤️❤️❤️