Memory allocation for value types...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im wondering how & where the memory is allocating for

int i; and int i=new int();

Thanks,
Veera.
 
veera said:
Im wondering how & where the memory is allocating for

int i; and int i=new int();

On the stack. In latter case i is initialized with zero.
 
Or, if i is a member variable of a class, it will be in the heap, but
relative to the base address of the object.

Mike.
 
Back
Top