Thread: static virtual functions

  1. #1
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162

    static virtual functions

    why virtual functions can't be static?

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Because static functions aren't inherited. They're associated with classes, not objects. virtual is associated with calling member functions from pointers to objects.

  3. #3
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162
    Quote Originally Posted by Dante Shamest
    Because static functions aren't inherited.
    Is that the only reason

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  2. [GLUT] Pointers to class methods
    By cboard_member in forum C++ Programming
    Replies: 13
    Last Post: 02-16-2006, 04:03 PM
  3. Static Functions
    By Dae in forum C++ Programming
    Replies: 4
    Last Post: 10-23-2005, 08:45 PM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM