Added: 2 years ago
From: xoaxdotnet
Views: 18,341
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (18)

Sign In or Sign Up now to post a comment!
  • this is very good for student

  • Great instruction, the only critique is that it would be nice to be able to view the entire code versus the zooming in on a section some times.

  • I hate the word pointer

  • in 5:38

    he says we "only" need to change the base destructor to virtual BUT

    he has also changed the derived destructor to virtual, without mentioning why!

    so why does he do that?

  • @tronulu if the a base destructor/method is virtual all methods that are derived from it will be virtual

  • Virtual functions are great for implementing interfaces. Think of a game class called GameObject that has two functions: virtual void Initialize() and virtual void Update(). You'll be creating many different types of GameObjects such as people, bullets, cars, chess pieces, etc. Instead of writing custom code to initialize and update every object, you'd like to be able to iterate over an array of GameObject pointers. Each derived GameObject implements its own Initialization and Update code.

  • thanx , it realy helpd me to understand the logic very easily and very quickly.

  • thanks a bunch.Awesome for noobs as well as refreshing concepts.

  • i don't understand virtual functions still ,why do we need them ? why not just overload functions ?

  • need urgent answer ,i still don't understand virtual functions ,but i don't see whats the use of them ? ,like whats the use of making a class with pure virtual functions that we can't use ,why not just make the classes we want with what we want ,same for the virtual functions ,why not just overload the functions ?

  • @hemagoku

    the purpose of virtual function is to have the priority. i.e let say your base class has function and derived class has a same function as well. If you created a base class pointer and point it to derived class object and call that one function due to the type of the pointer base class function will be executed unless the function is virtual and at that point derived class object function will be able to override the base class function.

  • @atifplus

    basically having virtual functions in base class let the derived class object use their own functions and if derived class don't have the function defined the base class will provide the function. As far as the use u never know when u can run into issue where u might need this type of functionality it is just a type of tool available for disposal :)

  • Thanks,

    Needed a quick refresher.

  • I havent really needed to use virtual function (although i have used them) but i have had to use other object orientated "things" like overloaing

  • thanks, great set of tutorials

  • 0.0!

    thanks for these vids, i've watched them all now

  • cool

  • O.O

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more