R
rishi.shah
I wanted to know how the compiler creates and allocates memory for an
object in C++. When I say
Foo obj
where Foo is a class does the memory for the attributes of class Foo
get allocated on the stack before the default constructor is called or
is memory allocation on the stack done by the constructor? Is object
creation a two step process(allocation of memory on stack followed by
calling the constructor)?
object in C++. When I say
Foo obj
where Foo is a class does the memory for the attributes of class Foo
get allocated on the stack before the default constructor is called or
is memory allocation on the stack done by the constructor? Is object
creation a two step process(allocation of memory on stack followed by
calling the constructor)?