Question on virtual inheritance
Home
FAQ
Contact
Sign in
Search
comp.lang.c++ only
Advanced search
POPULAR GROUPS
perl.cpan.testers
alt.bestjobsusa.computer
alt.bestjobsusa.computer.jobs
us.jobs
us.jobs.offered
alt.bestjobsusa.jobs.offered
news.admin.netabuse.sightings
alt.politics
it.politica
alt.fan.rushlimbaugh
more...
Up
Question on virtual inheritance
Group:
comp.lang.c++
·
Group Profile
Author:
ambarish.mitra
ambarish.mitra
Date:
Apr 23, 2008 23:55
#include
class base {
public: virtual void f() {}
};
class derived: public virtual base {
};
int main()
{
std::cout << "size of base = " << sizeof(base) <<
std::endl; /* =4 . This is Okay.*/
std::cout << "size of derived = " << sizeof(derived) <<
std:endl; /* 4 or 8 */
}
In MS environment (Visual Studio 6/7), the output is coming as 8,
whereas in g++ compiler (g++
3.4.5
), the output is coming as 4.
Can any1 tell how the internals work out for virtual inheritance in
these 2 compilers? (I hv checked that size of pointer =4 in both
systems).
2
Comments
diggit!
del.icio.us!
reddit!
RELATED THREADS
Subject
Articles qty
Group
Quer sexo real, virtual? - It wants real, virtual sex?
1
soc.culture.brazil
·