ma****@gmail.com wrote:
You haven't answered the question yet.
Greater or equal to sizeof(int)?
Does the later "adding " affect the result at all?
He DID answer your question. Let me reformulate, since you don't seem
to understand. The C++ language says this:
- sizeof(int) >= 1
- The size of any class is greater or equal to size of every member in
the class.
- If the class has any virutal methods then its size may be greater.
That's it. There's no way of knowing more precisely what sizeof(A) is.
If someone at an interview expected you to provide a more precise
answer without specifying which platform they are talking about then
they are clueless and you shouldn't bother trying to get the job they
are offering.
Bart.