Interview Question
Developer Program EngineersI guess it is impossible. I tried it on Ubuntu and the results are EXACTLY the same. Another interesting quesiton is that there is no "class" concept in C. why does author use "printf" instead of "cout"?
How will it depend on how the memory grows on the heap ??? both are adddresses , printed in hexadecimal .
And please don't be mean , if you can't answer something fully , don't bother commenting .I really hate it when one pulls someone's leg unnecessarily like that .
This can happen if the class B has virtual methods , while class A does not have them . In that case , the part of class A that is in class B , will have a non-zero offset . thus resulting in different addresses , no matter how your heap is .
will depend on how memory grows in heap.
- Anonymous June 01, 2011