Static Data Members & Methods in C++ OOPS | C++ Tutorials for Beginners #24

  Рет қаралды 620,830

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 342
@shashijaiswal688
@shashijaiswal688 3 жыл бұрын
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
@gilgamesh9735
@gilgamesh9735 3 жыл бұрын
thanks bro
@zeeshan1019
@zeeshan1019 3 жыл бұрын
Sooo much thanks bro
@sufiyanmogal1527
@sufiyanmogal1527 2 жыл бұрын
Thanks bro
@akashisenju9386
@akashisenju9386 9 ай бұрын
🎉
@BGMI_MONTAGE008
@BGMI_MONTAGE008 5 ай бұрын
very good bro thanks
@AshutoshKumar-fu6qe
@AshutoshKumar-fu6qe 3 жыл бұрын
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
@hwaiting3573
@hwaiting3573 3 жыл бұрын
Edit the first one : add "only " after access
@AshutoshKumar-fu6qe
@AshutoshKumar-fu6qe 3 жыл бұрын
@@hwaiting3573 Thanks
@hwaiting3573
@hwaiting3573 3 жыл бұрын
@@AshutoshKumar-fu6qe No problem
@rickk3300
@rickk3300 3 жыл бұрын
👍👍
@nikhilrawat3959
@nikhilrawat3959 3 жыл бұрын
absolutely correct 👍👍
@nikitabhosale51
@nikitabhosale51 4 жыл бұрын
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.
@manishkasera8584
@manishkasera8584 4 жыл бұрын
OK Agli baar se ho jaega sayad
@yashrawat747
@yashrawat747 2 жыл бұрын
@@manishkasera8584 ho gya kya ?
@salmanmohammed2770
@salmanmohammed2770 3 жыл бұрын
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;
@vbp123
@vbp123 2 жыл бұрын
Udumy me Abdul Baari sir kaisa padhte he c++?
@nookalareshwanth1785
@nookalareshwanth1785 11 ай бұрын
bro didn't lose the habbit to use semicolon;
@AshutoshKumar-fu6qe
@AshutoshKumar-fu6qe 3 жыл бұрын
I watch till very end to listen to the music. It's satisfying a lot.
@Shanuraig
@Shanuraig Жыл бұрын
Same here bro 🤣
@pankajlega8862
@pankajlega8862 Жыл бұрын
😂same here
@indra7018
@indra7018 Жыл бұрын
Same lol
@Shubhamsingh-ym6it
@Shubhamsingh-ym6it 6 ай бұрын
You can directly skip the video till end, don't waste your time
@dikshamalik2565
@dikshamalik2565 2 жыл бұрын
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
@nithish_raina
@nithish_raina 4 жыл бұрын
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.
@omkargunjal1611
@omkargunjal1611 4 жыл бұрын
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
@dheerajaggarwal606
@dheerajaggarwal606 3 жыл бұрын
Bhai yar muje kuch smaj nahi aara h 😭 opps se please help kro 😭
@Ramdut369
@Ramdut369 3 жыл бұрын
DS and algorithms pe bhi banao please
@silverpenetrator739
@silverpenetrator739 3 жыл бұрын
@@dheerajaggarwal606 College mai ho ya nahi? Mujhe bhi difficulty ho rahi hai thodi si is topic pe.
@dheerajaggarwal606
@dheerajaggarwal606 3 жыл бұрын
@@silverpenetrator739 hu 😭
@skybags365
@skybags365 3 жыл бұрын
@@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.
@muskankushwah7062
@muskankushwah7062 2 жыл бұрын
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.
@chiragparmar1964
@chiragparmar1964 2 жыл бұрын
hey even I started c++ and about to start DSA would you like to group study with me online?
@tanishbajaj4952
@tanishbajaj4952 2 жыл бұрын
post jee?
@chiragparmar1964
@chiragparmar1964 2 жыл бұрын
@@tanishbajaj4952 what?
@molikagarwal564
@molikagarwal564 2 жыл бұрын
@@chiragparmar1964 i am in , where can i contact you
@mahaveerhirawat7323
@mahaveerhirawat7323 Жыл бұрын
@@chiragparmar1964 nei degi bhai...
@harshkharwar9352
@harshkharwar9352 4 жыл бұрын
Thnx Harry sir.
@atishayjain4452
@atishayjain4452 2 жыл бұрын
Harry bhai please put the question content also just like in C course
@muhammadtayyab6721
@muhammadtayyab6721 Жыл бұрын
1:17 Static data member 11:09 Static member function
@mayankmaurya3521
@mayankmaurya3521 4 жыл бұрын
Great Video sir Really helpful
@everymoment9422
@everymoment9422 3 жыл бұрын
Thanks sir your all video is very helpful
@Voyager_Plays
@Voyager_Plays 4 жыл бұрын
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
@mohsinabbas9464
@mohsinabbas9464 2 жыл бұрын
Thank you Harry Bhai. This is very helpful for me.
@ritikabali6466
@ritikabali6466 4 жыл бұрын
so grateful to you sir for these videos.
@JenilMendpara
@JenilMendpara 2 жыл бұрын
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
@jawadbilal5557
@jawadbilal5557 4 ай бұрын
Nice work🎉
@indrajeetsinhdeval5955
@indrajeetsinhdeval5955 3 жыл бұрын
Every videos are awsm great help to my future Thank you so much👌👌👌👌👌
@technicalutkranti
@technicalutkranti 2 жыл бұрын
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 ?
@prajaswadekar3157
@prajaswadekar3157 2 жыл бұрын
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 ...)
@timepassscript
@timepassscript 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)
@kamranaesthetics
@kamranaesthetics 4 жыл бұрын
Thanks Harry bhai!😊
@sudhakarsahu344
@sudhakarsahu344 4 жыл бұрын
cout
@abcefg7045
@abcefg7045 3 жыл бұрын
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
@md_asharaf
@md_asharaf 2 жыл бұрын
they can access static data functions too bro
@dangerouscoder6057
@dangerouscoder6057 3 жыл бұрын
sir apka video dek kar 90% clear hota hai , orr baki 10% joki question reheta hai jiska ans nehi milta
@JD_shots_SJ
@JD_shots_SJ 3 жыл бұрын
Thank you so much Harry bhai for making this video 🌹☺️
@AhmedRaza-ty7zq
@AhmedRaza-ty7zq Жыл бұрын
Awesome video😎😎👍👍
@rawat_ji5183
@rawat_ji5183 4 жыл бұрын
dhanayawad harry bhiya
@rishunandan4725
@rishunandan4725 3 жыл бұрын
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 .....
@vaibhav7457
@vaibhav7457 3 жыл бұрын
ans>
@killerboychetan
@killerboychetan 2 жыл бұрын
Jaise complex ka kiya tha waise he isko bhi karna hai
@killerboychetan
@killerboychetan 2 жыл бұрын
They both are similar
@mightyasjed
@mightyasjed 3 жыл бұрын
ending music is awesome harry bhai you are one of the peoples who are changing the future love from pakistan
@siddhibhalekar9477
@siddhibhalekar9477 3 жыл бұрын
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....🧡🧡🧡
@petsgestures
@petsgestures Жыл бұрын
yep you are exactly right.....He uses very tough example for code to understand us...but these tough examples create very confusions
@PriyanshuSingh-ky8jt
@PriyanshuSingh-ky8jt 5 ай бұрын
@@petsgestures lol you guys don't have coder minset so leave it
@nilmanitiwari6611
@nilmanitiwari6611 2 жыл бұрын
Sir, please add some questions between the video because I am beginner and don't have any experience that how to approach questions...
@aishvaryamohite5985
@aishvaryamohite5985 3 ай бұрын
Well done understanding the static data member
@atharvpatharkar1652
@atharvpatharkar1652 3 жыл бұрын
Thank You 🙏🏻
@codewithgagan
@codewithgagan 4 жыл бұрын
I waiting this video 😀😀
@PriyankaPatel-gx3pj
@PriyankaPatel-gx3pj 4 жыл бұрын
Sir you are doing grear job
@mohitchouhan7679
@mohitchouhan7679 10 ай бұрын
very useful content and easy to understand
@ustadsandeepmaheshwari2913
@ustadsandeepmaheshwari2913 4 жыл бұрын
Harry bhai your videos series is outstanding
@akapkaapnacomady7228
@akapkaapnacomady7228 3 жыл бұрын
Sir apka samjhane ka tarika best hai
@ridamjain5767
@ridamjain5767 3 ай бұрын
thanks sir for giving out videos although it is so many years 😂😂 and i didnt even saw it And although very good video
@kuldeepgngwr2096
@kuldeepgngwr2096 4 жыл бұрын
thank you so much sir ji.
@Priya-hr5si
@Priya-hr5si 3 жыл бұрын
Very good explain sir
@csssatyamjadhav7681
@csssatyamjadhav7681 3 жыл бұрын
great work sir...Thanks for the video.. Harry bhai
@cr7johnChan
@cr7johnChan 3 жыл бұрын
Static functions do not need any object to run Static functions can access only static variables
@nehaakoli99
@nehaakoli99 4 жыл бұрын
Can u extend machine learning tutorial by explaining swarm intelligence ,ant colony algorithm??
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
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
@muhammadareebkazmi9476
@muhammadareebkazmi9476 2 жыл бұрын
ahhh Thank you, Harry bhai!
@techlopediahindi7988
@techlopediahindi7988 4 жыл бұрын
Hey pls make a playlist on ethical hackimg course
@sailendrachettri8521
@sailendrachettri8521 4 жыл бұрын
Yes, Do!
@gautamchaudhary3325
@gautamchaudhary3325 3 жыл бұрын
+++
@techlearnwithsharmaji3204
@techlearnwithsharmaji3204 3 жыл бұрын
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
@khushisingh2101
@khushisingh2101 3 жыл бұрын
Notes discription mai hote hai bro
@kvkv2856
@kvkv2856 3 жыл бұрын
Thank you bhaiya❤️
@victorb22622
@victorb22622 8 ай бұрын
5:09 x static vatiable को आप क्लास के अंदर नही बाहर लिख सकते है। 5:54 में फिर से static int count class के अंदर ही लिखा।
@keshav8269
@keshav8269 6 ай бұрын
Declare andar karna hota ha Bahar likh ka usa memeory milti ha mtlb memory allocate hoti ha Aur initialise bhi bahar karni padti ha ,
@self-mentoring6657
@self-mentoring6657 4 жыл бұрын
sir? Will you be adding the videos on STL in c++ in this playlist?
@manishkasera8584
@manishkasera8584 4 жыл бұрын
kr dega to chaar chand lg jaega
@kumarharsh90
@kumarharsh90 4 жыл бұрын
@@manishkasera8584 kr diya add
@shantanusingh2039
@shantanusingh2039 2 жыл бұрын
The only loophole is the videos are too short , with not very much examples/exercises :)
@mohinishendye1040
@mohinishendye1040 3 жыл бұрын
Greatt!!!👍👍👍
@shashijaiswal688
@shashijaiswal688 3 жыл бұрын
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.
@md_asharaf
@md_asharaf 2 жыл бұрын
absolutely right my dear.hv u completed your cpp learning?
@ayansrivastava731
@ayansrivastava731 2 жыл бұрын
@@md_asharaf tharki bc xD
@Techny
@Techny 4 жыл бұрын
bro amaazzzziiiing course!!!!!!!
@dipanshsaxena5192
@dipanshsaxena5192 3 жыл бұрын
Summary on 14:52
@ustadsandeepmaheshwari2913
@ustadsandeepmaheshwari2913 4 жыл бұрын
Thanks aap bahot acche videos banate hai
@jokestudio15
@jokestudio15 Жыл бұрын
Static variable ~ class variables
@garvitpahwa267
@garvitpahwa267 2 ай бұрын
well explained sir
@jitendra503
@jitendra503 4 жыл бұрын
Thanks
@sagarvlogs7707
@sagarvlogs7707 2 жыл бұрын
Harry Bhaiya you teahing is osm...
@KK-hd4wy
@KK-hd4wy Жыл бұрын
Really learned a lot
@dreamerb1
@dreamerb1 Жыл бұрын
Harry bhai you are the best❤️
@Ramdut369
@Ramdut369 3 жыл бұрын
Data structures or algorithms pe bhi video banao bhaiya
@nehalsingh785
@nehalsingh785 3 жыл бұрын
awesome tutorial sir
@sheshanksidheshwar9846
@sheshanksidheshwar9846 2 жыл бұрын
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.?
@timepassscript
@timepassscript 2 жыл бұрын
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.
@n.lsharma8751
@n.lsharma8751 Жыл бұрын
Sir aapne itni mehnat ki hai ,sir thodi or mehnat karke sir aapko Ed do question karvane chahiye the
@anandchoudhary9283
@anandchoudhary9283 Жыл бұрын
In my college I have to face huge problem of language because all the lectures are taken in Gujarati language This man help me
@susilrajneupane1745
@susilrajneupane1745 4 жыл бұрын
Thank you bhai :) :)
@Cyber_pk320
@Cyber_pk320 Жыл бұрын
Harry bhaiya ...kya dynamic memory allocation yahi hai??
@simranbains6199
@simranbains6199 2 жыл бұрын
thank you so much bro
@twi4458
@twi4458 3 жыл бұрын
Thankyou Harry Bhaiya
@PegasiuuuS
@PegasiuuuS 4 жыл бұрын
6:30 have to declare ststic variables outside of class these are by default initialized at 0
@PegasiuuuS
@PegasiuuuS 4 жыл бұрын
this comment is just for my referance.
@AshutoshKumar-fu6qe
@AshutoshKumar-fu6qe 3 жыл бұрын
KZbin will strike you for guidelines you are using comment section for personal purpose.
@mohammadmohsinmohammedmohs9717
@mohammadmohsinmohammedmohs9717 4 жыл бұрын
HEY how to get object name in runtime?
@abhijaysaraswat83
@abhijaysaraswat83 3 жыл бұрын
can a static function be defined outside the class using scope resolution operator'::'.what if we only create the prortotype or declaration of the static function inside the class like we do with other normal functions?
@rickk3300
@rickk3300 3 жыл бұрын
Try it in your IDE, and check whether it works or not.
@arnab_mandal_01
@arnab_mandal_01 3 жыл бұрын
@@rickk3300 working bro
@pratikkadam540
@pratikkadam540 3 жыл бұрын
@@arnab_mandal_01 can u send me how u wrote the prototype inside class and the the function outside class using scope resolution
@pratikkadam540
@pratikkadam540 3 жыл бұрын
Hey bro it's working 😅
@arnab_mandal_01
@arnab_mandal_01 3 жыл бұрын
@@pratikkadam540 ✌🏻😊
@skymusic0_9
@skymusic0_9 2 жыл бұрын
Sir please ap hamain har video ke sath koi practice task bhi de diya karain .....! thanks
@Gurps7
@Gurps7 3 жыл бұрын
I just got essence of it after changing variable to 1000!
@harshshukla3978
@harshshukla3978 3 жыл бұрын
Do we use static variable only in class?
@nikhilraj1842
@nikhilraj1842 4 жыл бұрын
Harry bhai ham n dimensional vector kaise bana sakte hae cpp me
@dharmendrachauhan3640
@dharmendrachauhan3640 4 жыл бұрын
soo, nice harry bhai
@harshsingh2289
@harshsingh2289 Жыл бұрын
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....
@deveshudhlani8295
@deveshudhlani8295 3 жыл бұрын
ye itni acchi video ko unlike kon karrha hai?
@AshutoshKumar-fu6qe
@AshutoshKumar-fu6qe 3 жыл бұрын
Dislike hota hai unlike nahi
@learncseasily3385
@learncseasily3385 3 жыл бұрын
@@AshutoshKumar-fu6qe 🤣🔥
@codewithgagan
@codewithgagan 4 жыл бұрын
Thankyou sir ji
@shivamuttpaljha3134
@shivamuttpaljha3134 4 жыл бұрын
Haary bro aapne is series me ek bhi project ni dala hai jisse ye series thoda boring lg ra Pls kirpya krke c++ programming mei kuch projects dal dijiye jisse ki hume pdhne me aur bhi maja aaye🙏🙏
@shivamuttpaljha3134
@shivamuttpaljha3134 4 жыл бұрын
Plss bhai
@tahirummati4503
@tahirummati4503 Жыл бұрын
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 ....
@sohaasif1385
@sohaasif1385 2 жыл бұрын
Scope resolution operator kis video mn explain kia hua hai?
@ahirjatin5418
@ahirjatin5418 3 жыл бұрын
Thnx Harry sir
@Vivekraj-i9f7x
@Vivekraj-i9f7x Жыл бұрын
15:46 what is utility function
@kumkumbhagya51
@kumkumbhagya51 Жыл бұрын
15:07 maine id ko bhi static bana diya aur print krva diya😂
@KaRToONS_13
@KaRToONS_13 Жыл бұрын
Harry bhai kahi aapne balaguruswami cpp ko reference toh nai banaya kyon ki aapke se sare topic usi book ke hisab se sequence mein hai 😁
@subratamajumder8188
@subratamajumder8188 2 жыл бұрын
bhaiyaa why does count return the value 1 when we entered the first id ? since the command is count ++ shouldn't it return " the employee number is 0" ? matlab iske baad phir 1 ,2 .. aisa krke show karega na?
@divilthakur4671
@divilthakur4671 2 жыл бұрын
its bcz count was 0 , when he apply count++ then it inc itself be 1 just like same happens in loops when we write i++ then in loops it inc its value but suppose u created a variable a and stores count value in it , then when u cout
@DarkWorld0000
@DarkWorld0000 2 жыл бұрын
Love 💕💕💕💕
@codenamedangerozone4050
@codenamedangerozone4050 3 жыл бұрын
Thank you
@ustadsandeepmaheshwari2913
@ustadsandeepmaheshwari2913 4 жыл бұрын
1 question hum agar employee ki id daale to uske information aae aisa nahi hosakta kya hum jo id daal rahe hai wo hume wahi id print karke deraha hai
@RohitRaj-qe2rp
@RohitRaj-qe2rp 4 жыл бұрын
yes bro u you can gain knowldege and try it.
@MunazaIqbal-vg1hv
@MunazaIqbal-vg1hv 2 ай бұрын
Sir program provide Karen or Koch practice q bhi
@natt5chanel583
@natt5chanel583 3 жыл бұрын
Can we use global in this instead of static
@PrinceUpadhyayneeraj
@PrinceUpadhyayneeraj 4 жыл бұрын
Harry bhai django ke follow unfollow models par bhi video bna do
@himanish2006
@himanish2006 4 жыл бұрын
Datastructure and algorithm
@rnikhilkumar9371
@rnikhilkumar9371 3 жыл бұрын
Why static function allows itself to define it inside of class but static datatype doesn't?
@samyakbharsakle
@samyakbharsakle Жыл бұрын
cfbr good stuff
Friend Functions in C++ | C++ Tutorials for Beginners #26
20:02
CodeWithHarry
Рет қаралды 676 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Static Data Member in C++ | C++ Programming | In Hindi
21:08
codeitup
Рет қаралды 90 М.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,6 МЛН
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 843 М.
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
C++ Static Members (Variable & Function) | Learn Coding
13:08
Learn Coding
Рет қаралды 261 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН