-
Junior Member
c++
can a constructor be virtual
-
Junior Member
Re: c++
No constructors can not be virtual but destructors can be virtual.
-
Junior Member
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.
-
Junior Member
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
-
Forum Rules