STATIC VARIABLE OR STATIC DATA MEMBER IN C++ -24

Sdílet
Vložit
  • čas přidán 6. 02. 2017
  • STATIC VARIABLE OR STATIC DATA MEMBER
    In this video we will learn the Static Keyword in C++.
    We will learn about Static Variables , their syntax and
    Simple Program to understand the concept clearly.
    We will see Difference between a Regular and a
    Static Variable In C++ as well as Properties of Static Variable
    Enjoy Learning.
    Note :- "A C++ program can run successfully without a return statement (return 0) "
    Mail: Aniproguy@gmail.com
    Music:SUNDAY MORNING by Nicolai Heidlas Music / nicolai-heidlas
    Creative Commons - Attribution 3.0 Unported- CC BY 3.0
    creativecommons.org/licenses/b...
    Music provided by Audio Library • Video
    ------------------------------------------------------------------------------------------------
    Suggested Videos
    Function Overloading (FUNCTION IN C++ - PART 4) :- • Function Overloading (...
    Void or Generic Pointer in c++ :- • Void or Generic Pointe...
    Variables and Data Types in C++ :- • Variables and Data Typ...
    Data Type Range in C++ :- • Data Type Range in C++...
    Comments in C++:- • Comments in C++ -7
    Inline Function - FUNCTION IN C++ (PART - 3) :- • Inline Function - FUNC...
    Function Overloading (FUNCTION IN C++ - PART 4)
    • Function Overloading (...
    Class and Objects(part-3)[VISIBILITY MODES IN C++] :- • Class and Objects(part...
    Class and Objects[Most Important Video] Part-5 (Complex Number Program)
    • Class and Objects[Most...
    STATIC FUNCTIONS IN C++ :- • STATIC FUNCTIONS IN C+...
    CONSTRUCTOR IN C++ ( SYNTAX AND PROGRAM AND ALL POSSIBLE ERRORS)
    • CONSTRUCTOR IN C++ ( S...
    STATIC VARIABLE OR STATIC DATA MEMBER IN C++ :- • STATIC VARIABLE OR STA...
    Constructor Overloading in C++- :- • Constructor Overloadin...

Komentáře • 129

  • @soniyapol5755
    @soniyapol5755 Před 2 lety +20

    I was not getting the concept the whole semister ....then thought to give up on this point ..but came across ur video ...i m now crystal clear with the concept....thanks❤️

  • @Misc_useful
    @Misc_useful Před 6 lety +44

    world needs teachers like you...!!! good

    • @Codearchery
      @Codearchery  Před 6 lety +8

      Thanks Vikranth for such a wonderful Comment.
      Everything is Simple , I don't know why teacher made them look like hard

  • @AbhijitDas-un2rr
    @AbhijitDas-un2rr Před 5 lety +11

    Made me understand in a Minute at which I was struck for a year. Thanks pal !

  • @bikdigdaddy
    @bikdigdaddy Před 2 lety +1

    you did it so precisely and i cant thank enough for clearing my doubts. thanks a lot.

  • @super4543
    @super4543 Před 5 lety +1

    I love this videos so much they make me understand C++ better!

  • @Codearchery
    @Codearchery  Před 6 lety +18

    In C++ , A Program can Run Successfully when int main() is left without a return value (return 0). Don't get confused :-) Newbie in Programming doesn't know this concept

  • @skyblue3044
    @skyblue3044 Před rokem +2

    These 5minutes helped me more than my teacher to whom I paid in thousands! Thank you :)

  • @messiisthebest
    @messiisthebest Před 2 lety +1

    Under-rated channel ,hope this channel gets a lot of recognization

  • @jeel1721
    @jeel1721 Před 6 lety +5

    Without saying any single word you are teaching us very well👏

    • @Codearchery
      @Codearchery  Před 6 lety +1

      Thanks Jeel for watching my videos
      I hope you'll like to share my channel with your friends :-)
      Keep on watching Jeel

  • @DilpreetSingh0
    @DilpreetSingh0 Před rokem +2

    Very simple and to the point explanation. Good job 🫡

  • @haseeburrehman6013
    @haseeburrehman6013 Před 4 lety

    Best teaching method ,i have specially login to my gmail to comment and like,and i am amazed why not people watch a briliant videos

  • @triptishrivastava166
    @triptishrivastava166 Před 6 lety +1

    Smoothly you explained the whole concept

  • @user-pw2et9re1r
    @user-pw2et9re1r Před 3 lety +1

    Thanks for the video! Nice and clear! Keep up the good work

  • @muhammadwaleed2406
    @muhammadwaleed2406 Před rokem

    The most creative video I ever came across 🙏

  • @mechanicalbaba2484
    @mechanicalbaba2484 Před 2 lety

    Off course, this video deserves LIKE, great explanation

  • @dipeshchandiramani1897

    Very good quality content! Thank You!!

  • @davlatbekkobiljonov911

    Thank you very much, explained very proffesionally and funny!

  • @rohitghadge9173
    @rohitghadge9173 Před 5 lety +1

    Explanation method very nice.

  • @popeye7336
    @popeye7336 Před 3 lety

    one of the coolest tutorial man.

  • @sameersant2628
    @sameersant2628 Před 2 lety +1

    Really great explanation. Very easy to understand

  • @andreiasimov33
    @andreiasimov33 Před 5 lety

    Perfect, thank you very much stranger! :)

  • @aliastar5616
    @aliastar5616 Před 2 lety

    Oh my God the man best explain ever ❤️💙💙😍😍🤩🤩

  • @cookwithflame7544
    @cookwithflame7544 Před 2 lety

    Amazing work 🥰....thaks a lot bcos it helped me a lot

  • @user-vt8lg4oz9e
    @user-vt8lg4oz9e Před 11 měsíci

    that was amazing !!!! thank you so much

  • @hairstylesbeauty6112
    @hairstylesbeauty6112 Před 6 lety +2

    Nice way to explaning...C++....👍👍

    • @Codearchery
      @Codearchery  Před 6 lety

      Have you seen Codearchery.com teaser?
      czcams.com/video/cqLdlBaohLU/video.html
      Did you like it ?

  • @monikam245
    @monikam245 Před 4 lety

    This video helped Me a lot......thanks

  • @techtude
    @techtude Před 6 lety

    Wow dude you are osm this is the best technique to delever your content like in the cartoon format that's why this is very impressive keep your work dude
    Even you inspired me now on I'm gonna make this type of graphics in my videos too
    U r osm dude
    I'm very thankful to you by the very bottom of my 💓
    We love you.. always

  • @thearpitkatiyar637
    @thearpitkatiyar637 Před rokem +1

    continue making videos it will help a lot

  • @aartijarial748
    @aartijarial748 Před 5 lety

    Awesome video sir your learning trick is very good ☺

  • @siddharthkshirsagar2545
    @siddharthkshirsagar2545 Před 7 lety +3

    keep it up
    best way of explaning

    • @Codearchery
      @Codearchery  Před 7 lety

      Thanks a lot Siddharth Kshirsagar. Keep on Commenting and Watching my videos. Plz Share this among your friends :-)

  • @faranahmadk7401
    @faranahmadk7401 Před 3 lety

    very well explained. concept

  • @thaisimey896
    @thaisimey896 Před 6 lety

    Ur video so amazing!

  • @Cedrek
    @Cedrek Před 2 lety

    that was helpful , thank you

  • @ishaan854
    @ishaan854 Před 3 měsíci +1

    Aweosme❤❤

  • @zobiakhan3447
    @zobiakhan3447 Před 4 lety

    Thank you!!!!

  • @yashrawat1232
    @yashrawat1232 Před rokem

    best video fully understand without voice

  • @hengborchhay6388
    @hengborchhay6388 Před 7 lety

    like it and love it !!! plz continues plz

    • @Codearchery
      @Codearchery  Před 7 lety

      Thanks heng for watching my videos. Yeah ! I will continue making more videos. If u want me to make a video on any topic just comment on any of my video :-)
      Keep on Learning :-)

  • @lilshxv
    @lilshxv Před 2 lety

    thank you so much.

  • @abood8945
    @abood8945 Před 4 lety

    YOU GOT TO HAVE A MILLION SUBs

  • @vrushalikulkarni8632
    @vrushalikulkarni8632 Před 6 lety +3

    Rude one... 😂😂 couldn't get better.. Good job dude

  • @saifislam8556
    @saifislam8556 Před 6 lety +1

    Just awesome, bravo

    • @Codearchery
      @Codearchery  Před 6 lety

      Thanks a lot saif
      I hope You'll like to Help this channel by sharing it with your friends
      Keep on watching and Keep on Learning Cool stuff :-)

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    I LIKE YOU ......
    YOU ARE VERY GOOD DRAWING ...............
    YOU HAVE VERY HAPPY FUNNY TO FIND INTERESTING TO LEARN ..............
    THE MOST IMPORTANT HOW TO TEACH THE EASY WAY TO STUDY ...THE MOST SIMPLE BUT FUNDAMENTALS ....... PLATFORM

  • @parismoschovitis4410
    @parismoschovitis4410 Před 6 lety +1

    Would the functionality of a static variable be the same of a global one? Could I use a global function as my counter?

  • @mdsazidanirban8325
    @mdsazidanirban8325 Před 8 měsíci

    thanks a ton

  • @riyanplex5623
    @riyanplex5623 Před rokem

    It is informative video

  • @rabindramahato6950
    @rabindramahato6950 Před rokem

    Amazing 👏 🙀 😯

  • @ukeditz3
    @ukeditz3 Před 4 měsíci

    good effort ice teaching

  • @hrithikmenon7042
    @hrithikmenon7042 Před 6 lety +2

    Helpful one!!

    • @Codearchery
      @Codearchery  Před 6 lety

      Thanks Hrithik for watching my videos
      Keep on watching and help me by sharing my channel
      As you can see I don't have much subscribers

  • @kazimdanisurrahman6264

    osthir✌✌✌

  • @saranyasambandham8478
    @saranyasambandham8478 Před 5 lety

    super explanation

  • @ishwar1907
    @ishwar1907 Před 3 lety

    Thankyou thanku so much 😭😭

  • @subhankhal8785
    @subhankhal8785 Před 5 lety

    super thanks alot

  • @hasikadilshani278
    @hasikadilshani278 Před 5 lety

    great video

  • @winhtut1187
    @winhtut1187 Před 6 lety

    u great sir

  • @Harrypotter-fl6je
    @Harrypotter-fl6je Před 6 lety

    great video...
    Better to watch in 2x speed....

  • @Impulse_Photography
    @Impulse_Photography Před 2 lety +1

    Here's a question, and I hope I am not jumping ahead too far. If I have a class for parking spaces and need to count them each time a space is rented. This needs to be available to other functions in my class, and to the main(). Should this static variable 'count' be private in the class with other variables, or public so it can be accessed by anyone? Would I have to put it in the Global space so it is available outside the class ( to the function main() )?

  • @manasvinsharma1740
    @manasvinsharma1740 Před 3 lety

    Where was this channel for so many years woowwwww

  • @venkatr2307
    @venkatr2307 Před rokem

    Superb explaination..... please do videos for java also

  • @mrudulnagrale
    @mrudulnagrale Před 5 lety

    Thanks

  • @mohamedshehata8972
    @mohamedshehata8972 Před rokem

    nice video

  • @dracsoloment3970
    @dracsoloment3970 Před 4 lety

    could you say count = count++; to make the general variable actually incremement in main?

  • @samiulislamdurjoy
    @samiulislamdurjoy Před 3 lety

    00:01:35 cout

  • @muhammadkhalil5070
    @muhammadkhalil5070 Před 6 lety +1

    THE BEST THING ON THE INTERNET MUCH APPRECIATION!

  • @chetanreddy106
    @chetanreddy106 Před 6 lety

    Omg really awesome

    • @Codearchery
      @Codearchery  Před 6 lety

      Thanks Chetan
      Have you seen Codearchery.com teaser?
      czcams.com/video/cqLdlBaohLU/video.html
      Did you like it ?

  • @chandankumarsahu2048
    @chandankumarsahu2048 Před 4 lety

    Sir aap but ache se concept clear krwa the ho. Please c++ ke sare concept people video bnaye.

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    MAIN IDEAS OF STATIC OF C++ ? FOR ALL STUDENTS NOT ONLY FOR SMART STUDENTS ONLY .............
    MAKE SURE EVERY STUDENTS UNDERSTAND IN THE CLASS .................
    THE GOOD TEACHER IS THE ONE WHO DELIVER TO FIND THE BETTER WAY FOR ALL STUDENTS UNDERSTAND .............

  • @dynishaabreu4544
    @dynishaabreu4544 Před 6 lety +3

    Nice awesome video 😋buh...in video for general variable after initialising count to 0, it increments to 1 and again becomes 0 after end of the block, y does that happen?😅

    • @abufaya4155
      @abufaya4155 Před 5 lety +2

      Dynisha Abreu i too hav that doubt!!

  • @leifericson1658
    @leifericson1658 Před 2 lety

    Thanx

  • @atata0215
    @atata0215 Před 6 lety

    i use the compiler GCC 5.1.0, when i write :
    int x;
    cout

  • @sajalkarn7545
    @sajalkarn7545 Před 7 lety +6

    sir your video is best for it student
    point to point concept is cleared but sir we need more language like java ,data structure ,database so plzzz upload it as soon as possible

    • @Codearchery
      @Codearchery  Před 7 lety +4

      Hi sajal karn , thanks for Watching my videos and thanks for Commenting.
      I am going to upload videos on Data Structures soon. The Problem in uploading videos on lot of programming languages is time needed to make these videos. I have to spent 3 hrs for 5 min video , but I will try my best to upload as much videos as i can.
      Keep on learning and Please Share my videos so that they can help others too :-)

    • @sajalkarn7545
      @sajalkarn7545 Před 7 lety +1

      Learn Programming In Animated Way and I always obey

    • @Codearchery
      @Codearchery  Před 7 lety +1

      :-)

  • @prashantbhandari9499
    @prashantbhandari9499 Před 6 lety

    Best sir
    Keep it up

    • @Codearchery
      @Codearchery  Před 6 lety

      Thanks a lot prashant
      Have you seen Codearchery.com teaser?
      czcams.com/video/cqLdlBaohLU/video.html
      Did you like it ?

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    THANK YOU CODEARCHERY .............
    THANK YOU CZcams ....................................

  • @raihanhacks6726
    @raihanhacks6726 Před 3 lety

    thnks bro it is very help full to me . bro pls tell me is it like global variable in Python

  • @barnikroy3570
    @barnikroy3570 Před 3 lety

    Why do you have such low number of subscribers????.....you deserve to possess at least 1M.......

  • @user-bv6in5zj9b
    @user-bv6in5zj9b Před 5 lety

    what will happen if we created that regular variable in the heap?

  • @satwikbhardwaj123
    @satwikbhardwaj123 Před 2 lety

    Ohhh bete ki jaaann!!

  • @xgamer-od7mb
    @xgamer-od7mb Před 7 lety +1

    keep up the great work!!!

    • @Codearchery
      @Codearchery  Před 7 lety +1

      Hey Thanks a lot friend :-) for watching my video and for this comment :-)
      I like your Username "Hello World "
      Keep on Learning and Keep on Watching

  • @abufaya4155
    @abufaya4155 Před 5 lety +1

    I've never came across an explanation as good it is in ur vids!!
    But i have a doubt when u type
    cout

    • @sanyuktaagarwal5160
      @sanyuktaagarwal5160 Před 5 lety +3

      No, this is a syntax for Post fix i.e this syntax uses then changes the value. What output you expect is for ++Count;

  • @soniyapol5755
    @soniyapol5755 Před rokem

    I cant get garbage value when i remove static it gives the same 0 1 2.....why so?

  • @GGlearn
    @GGlearn Před 11 měsíci

    general variable after end of programs does not change, it become zero after running :int counter=0;

  • @satyamsolanki864
    @satyamsolanki864 Před 6 lety

    i need help in programming how we can communicate by other media

  • @interestingupdates900
    @interestingupdates900 Před 6 lety +1

    what if static variable is used inside a class?do we need to intialize it to 0?

    • @Codearchery
      @Codearchery  Před 6 lety +2

      No even In class we don't need to initialize it to zero
      Watch My Video on Virtual Function , You will Understand it :-)
      As You can see My Subscribers are very less in spite of lot's of Good Work
      Plz help me in growing my channel
      Share My Channel on Social Media and with your Friends too :-)
      I hope you'll like to help this channel
      Keep on Watching and Keep on Learning

    • @interestingupdates900
      @interestingupdates900 Před 6 lety

      For sure bro....

  • @iffatsoumee2991
    @iffatsoumee2991 Před 3 lety

    Why man why??
    U r soooooo much cute. All these above is extraordinary. Anyway take LUV

  • @NU_ASampathRajaRaghupathi

    Sir iam Sampath. What is the use of static variable

  • @black.clover.11
    @black.clover.11 Před rokem

    ooooooooopppp

  • @bamsgian9759
    @bamsgian9759 Před 4 lety

    is data member and variable are actually same thing?

  • @ranganakumar2129
    @ranganakumar2129 Před 4 lety

    i am not assigned any value to non-static variable,let it be assigned with some garbage value.
    while i am running the code getting out put in increment order as 0,1,2.

  • @arpitprajapati1933
    @arpitprajapati1933 Před 4 lety

    Please make videos on python

  • @speconcloud9
    @speconcloud9 Před 3 lety

    was a good video but watching this i felt like a nursery class child XD

  • @g3stimulate485
    @g3stimulate485 Před rokem

    how diifer static and global variable in c?

  • @MemoirsOfADrainCleaner

    I understand this concept, and I understand that with a static variable, but why exactly do we get 0 0 0 output

    • @christopherstromberg3070
      @christopherstromberg3070 Před 5 lety +1

      MR. LAYER it counts up to 1 at the end of the function, but when it returns to main that information gets tossed out. If you noticed it wasn’t even 0 until he set it to 0. It was just a bunch of random numbers. When it’s static that value is initialize to 0 and whatever is stored in the variable stays even after exiting the function. So each time the loop calls that function the value is incremented up when it’s static. When it’s a regular variable the value stored is reset every time the function returns to main.

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    WHAT DO YOU MEAN BLOCK ? I BLOCK IS BELONG TO THE PROGRAM AND BLOCK IS ONE PART SMALLER THAN PROGRAM IF SO FIT WHERE IN THE PROGRAM ............. OR BLOCK IS OUTSIDE THE MAIN PROGRAM OR WHERE IS THE BLOCK ?

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    DON'T FORGET YOU HAVE TO WRITE WHAT'S STATIC MEANS IN C++
    WHAT'S FUNCTION OR ACTION OR IS IT THE NAME OF CLASS OR SOMETHING AS YOU GIVE OUT DEFINITION OF STATIC FIRST ?

  • @surajnair1093
    @surajnair1093 Před 7 lety +2

    nice one.
    may you grow.
    Just improve the grammar :D

    • @BangMaster96
      @BangMaster96 Před 7 lety +2

      shut up about grammar dude
      it takes a lot of hard work to make these videos
      and you still complain
      typical indian behavior

    • @maniacarts9213
      @maniacarts9213 Před 6 lety +2

      @Sunny shah damn you are triggered really easily xD let him critic my friend.....it just helps improving ^^(as long as he doesn't get rude^^

  • @riyanplex5623
    @riyanplex5623 Před rokem

    Why don't you do voice over it will become more perfect (anime+voice= highly understandable)

  • @tranthaptinh
    @tranthaptinh Před 3 lety

    WHAT'S THE DIFFERENCE BETWEEN BLOCK AND THE PROGRAM ..............

  • @vivekdevkar4941
    @vivekdevkar4941 Před 5 lety

    How to define a static variable in a class?

  • @anitadevdare6813
    @anitadevdare6813 Před 4 lety

    for normal datatype it shows same result 0 1 2

  • @CodingMEasy
    @CodingMEasy Před 4 měsíci

    why did u stop making videos😢

  • @cm-r384
    @cm-r384 Před 4 lety

    Check your spelling. Otherwise, good video.