STATIC FUNCTIONS IN C++ - 25

Sdílet
Vložit
  • čas přidán 6. 02. 2017
  • STATIC FUNCTIONS
    In this video we will learn everything about Static Function .
    How to define and declare static function in Class.
    All properties of Static Function and How to call a Static
    Function in main function.
    Enjoy Learning.
    Mail: Aniproguy@gmail.com
    Music:THE HAPPY SONG 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++- 32 :- • Constructor Overloadin...

Komentáře • 64

  • @geoistalking
    @geoistalking Před 6 lety +19

    Told the lab assistant to explain me what's the deal with static functions.
    She said "they are important". :/
    Watched the video, told the lab assistant I understood why in 10 minutes, rather than 2 stupid hours of doing nothing
    Thaaanks

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

      Thanks for such a Wonderful Comment Alexandra.
      Share my channel with your lab assistant :-P
      Thanks for Watching

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

      lolx i dont even ask my teachers coz of these great youtube channels

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

    Why static function can only access static variables?
    Answer: Because the static function doesn't have a class instance so we can't reference non-static variables.
    Maybe help someone.

  • @misterhorse8327
    @misterhorse8327 Před rokem +1

    I love this. At first, I feel that I was being talked down on like a 5-year-old on how to understand C++. Then again, anything to help understand C++ as a 5-year-old is a boon. Thank you again!

  • @rohitchilhorkar8114
    @rohitchilhorkar8114 Před 3 lety +1

    Amazing Content!!
    It took just 2-3 minutes to understand it, I am sure i wil remember this very easily.
    Thank you codearchery!

  • @mallikarjunkomarraju6975
    @mallikarjunkomarraju6975 Před 5 lety +5

    Very Well said! u said it in 10min which our teacher couldn't tell in 40min.

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

      Thanks Mallikarjun :-)
      And don't forget to share this video with your Classmates.

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

    hey,your video is so good to learn the difficult concepts easily and even i just loved your way of teaching things ,...mostly the animation

  • @jdleanne
    @jdleanne Před 4 lety

    this video is very concise, straight hit to point. Ended with a cat is lovely idea!

  • @amulyabobbili9519
    @amulyabobbili9519 Před 6 lety

    very nice videos . they increased my coding knowledge

  • @victorlazarus5221
    @victorlazarus5221 Před 6 lety

    Thanks for the great videos!!

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

    Thank you...the "way of explanation" is much easier to understand the concept with no confusion...

    • @Codearchery
      @Codearchery  Před 7 lety

      Thanks nikhi , Keep on Watching and Keep on Learning

  • @saraibrahim5811
    @saraibrahim5811 Před 4 lety +1

    Oh thank you for this simple ,clear explanation

    • @mudassirnazar6368
      @mudassirnazar6368 Před 4 lety

      czcams.com/channels/VoUouiJy2NJebt8uJX5xhw.html
      👆 Check this link it may help you for c++ programming

  • @samiulislamdurjoy
    @samiulislamdurjoy Před 3 lety +1

    point to be noted..
    00:01:10 this statement must be written
    00:01:47 memorize bullets point
    00:03:43 rule of calling static function is different

  • @chrischauhan1649
    @chrischauhan1649 Před 5 lety

    Fantastic explanation thanks man.

  • @himanshunayak5343
    @himanshunayak5343 Před 6 lety

    Your videos are fantastic bro...

  • @roopagaur8834
    @roopagaur8834 Před 6 lety

    Thank you so much...... I just love your way of teaching.....💕😊👌🏼

    • @Codearchery
      @Codearchery  Před 6 lety

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

  • @hacnaiin
    @hacnaiin Před 3 lety +1

    Hey. This tutorial was really helpful. Thanks for creating it. But i hv one question. I wrote this exact same code in my DEV C++ complier and called the static function by the object of the class and it generated the same output as generated by the function called by class name. Hope you'll answer this. Love.

  • @rudrapavankumar4607
    @rudrapavankumar4607 Před 6 lety

    you are just awesome bro

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

    i am learning by watching your videos

    • @Codearchery
      @Codearchery  Před 7 lety

      Thanks Muhammad , Keep on Learning. My videos are becoming better and better , and I hope you'll love to keep on learning through my videos. Share these with others too Muhammad :-)

  • @shubhash3537
    @shubhash3537 Před 4 lety

    thanks dude

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

    Thank u so much (y)
    

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

    I understood this concept, but where we should use static member functions what is the use and tell some real time example also

  • @redalaadaili7022
    @redalaadaili7022 Před 4 lety

    i like this way how you explain

  • @IshaqKhan-rk5bl
    @IshaqKhan-rk5bl Před 6 lety

    great man

  • @samiulislamdurjoy
    @samiulislamdurjoy Před 3 lety +1

    note: satic variable value need notn be inniatialised .by default it is zero unlike a normal variables containing garbage valuse in case not value-initialised .
    note:you have to call static function by using class name followed by scope resolution

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

    Thank you very much!

    • @Codearchery
      @Codearchery  Před 7 lety

      I am happy that you like it Dung Tri :-)
      Keep on Watching , My Channel got lot of Good Stuff
      I hope you would like to help me by Sharing My Channel with your Friends

  • @aarfeenanees9147
    @aarfeenanees9147 Před 6 lety

    Hey bro can you please explain t me what is strcpy? I've searched the net for simple explanation but all I find i complex definitions with technical terminologies which i don't understand..

  • @narendranari8811
    @narendranari8811 Před 4 lety

    To make video on constant member function please

  • @namrathama4231
    @namrathama4231 Před 5 lety

    Tqsm 👏👏👏

  • @RaviKumar-xw5jo
    @RaviKumar-xw5jo Před 5 lety

    What is need using static members and functions in the program?

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

    thank you so much

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

      Thanks Yorikotah for watching my videos and for Subscribing
      Sorry for my late reply
      Don't forget to help this channel by sharing it with your friends
      Keep on watching and Keep on Learning Cool stuff :-)

  • @3DPlayground491
    @3DPlayground491 Před 2 lety

    cant we use obj1.showcounter to call the function??????:)))

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

    If I am declaring a static function, then is it not necessary to tel to compiler that it is a static function just like we telling about
    static variable?

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

      Ashish Rawat yes, you are right. Because Static data member should have to be initialized​ as it is declared but due to declaring it inside the class we cannot initialize it there, so we initialize it outside the class but a static function doesn't have to be declared separately.
      You can watch my video on Static Member Function.
      Link: czcams.com/video/9Fp91lFA6XE/video.html

  • @theradhikagupta
    @theradhikagupta Před 5 lety

    Hi team please make lectures on c++11 concepts

  • @theradhikagupta
    @theradhikagupta Před 5 lety

    And on design patterns also

  • @kevinbiju5777
    @kevinbiju5777 Před 9 měsíci

    Void increment ( ) is not a static function then how can it increment the value of static variable counter

  • @yogkumar4726
    @yogkumar4726 Před 3 lety +1

    We didn't initialised the counter variable, how is it initialised by 0.
    Also if there will be two variables/objects of that class demo then will the static variable will be same for both objects?

    • @anishmanandhar1203
      @anishmanandhar1203 Před 3 lety +1

      counter is a static variable so by default its value is initialised 0

    • @yogkumar4726
      @yogkumar4726 Před 3 lety

      @@anishmanandhar1203 ok thanks...if you can clarify on the second part of the question it would be helpful again..

    • @anishmanandhar1203
      @anishmanandhar1203 Před 3 lety

      @@yogkumar4726 ​ That was indeed a good question, firstly the static variable are meant to be used without creating the object, but even if you want to create the object that's fine. So if you create the two objects of the same class the static variable's property is shared meaning the scope of the variable persists throughout the program

    • @yogkumar4726
      @yogkumar4726 Před 3 lety

      @@anishmanandhar1203 so that means the value of static variable will remain same for every object ie if it is changed for one object then it will be changed for the other object also, right?

  • @akhilgupta7608
    @akhilgupta7608 Před 6 lety

    what will happen if there was two object in above same program. And I want to call the showcounter function for any one object then in that case how compiler will deal with that situation.

    • @sonu-uq1um
      @sonu-uq1um Před 6 lety

      compiler will take only that object

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

    Great !!
    But as always have a doubt
    U SAOD THAT
    Only static function can access static data members but how can
    Non-static member function can access and increment the value of a static data member in class;
    Plzz clarify me....

    • @darklight8346
      @darklight8346 Před 4 lety

      Static function can only access static members.
      Non-static function can access both static and non-static members.

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

    great

    • @Codearchery
      @Codearchery  Před 7 lety

      Hey jack , thanks for this comment.
      By the way I like your name Jack Sparrow :-)

  • @md.sabbirhossainbhuiyan9954

    U r wowsome.......

  • @hosnainrafi3351
    @hosnainrafi3351 Před 2 lety

    Please don't add this type of music..It is breaking our concentration.

  • @caleb7799
    @caleb7799 Před 2 lety

    THIS IS WAY TOO FAST. COME ON NOW. WE CAN BARELY READ THE PROGRAMS BEFORE YOU MOVE ON TO ANOTHER THING.

  • @abhishekupadhyay3805
    @abhishekupadhyay3805 Před 3 měsíci

    This one is the worst video in my life 😡😡