I have some Basic Questions about Objects in C++ :
Consider a class below (Just as an Example) -
a) What Picture in the Memory will be Created ?Code:class Abc { public: int a ; short b ; char cc ; public: Abc() { a=1 ; b=2; cc=4 ; } ; void HelloWorld() { printf("Hello World\n\n") ; } } ; Abc J ;
b) Where the Data Members are Placed ?
c) Where the Member Functions are Placed ?
d) How they will be Located, when a user use "J.b" and "J.HelloWorld()" ?
e) On VC++ 6.0, Why the Size of Abc is 8 Bytes ?
f) What is the Memory Footprint of this Object J ?
Thank you !!
-Vipul Pathak, India.




Reply With Quote