can we use virtual constructor in C++?

Discussion in 'Programming' started by Harris21, Aug 29, 2010.

  1. #1
    we use virtual function and virtual destructor n c++ but can we use virtual constructor in C++?
     
    Harris21, Aug 29, 2010 IP
  2. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #2
    A constructor can not be virtual because at the time when constructor is invoked the virtual table would not be available in the memory, hence we can not have virtual constructor

    Also, let me google that for you
     
    Rainulf, Aug 30, 2010 IP