Results 1 to 4 of 4

Thread: c++

  1. #1
    Junior Member
    Join Date
    May 2008
    Answers
    1

    c++

    can a constructor be virtual


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    9

    Re: c++

    No constructors can not be virtual but destructors can be virtual.


  3. #3
    Junior Member
    Join Date
    May 2008
    Answers
    4

    Re: c++

    Dear arpan
    constructor can not be virtual ,if u declare it as virtual ,1-object can not be create,2-again on dt time v table also not created.3-virtual means dt fun should define in the derive class too but constructor scope is with in a class it can not inherited.


  4. #4
    Junior Member
    Join Date
    Jun 2008
    Answers
    2

    Re: c++

    No constructor can not be virtual because when u declare a member function as virtual a V-table is created for that class in which the address of this virtual function is stored.. and the constructor initializes this V-table..so if we declare this constructor as virtual then its V-table can not be created... I think u got the point...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact