karthikeya
asked on
memory storage
Pls give me a soln for the following problem
i hope there are 3 types to derive an object
1- stack area
2- heap are
3- data area
for ex:
// object derivation in data area
class mydataobject
{
} data1,data2;
// object derivation in heap area
class myheapobject
{
};
void main()
{
myheapobject heap1= new myheapobject();
}
// object derivation in stack area
class mystackobject
{
};
void main()
{
mystackobject stack1;
}
suppose we are having some member variables like a,b,c
now for the above derived object like myheapobject,mystackobject ,mydataobj ect
where does the member variables stored either in stack or in heap
pls explain me
i hope there are 3 types to derive an object
1- stack area
2- heap are
3- data area
for ex:
// object derivation in data area
class mydataobject
{
} data1,data2;
// object derivation in heap area
class myheapobject
{
};
void main()
{
myheapobject heap1= new myheapobject();
}
// object derivation in stack area
class mystackobject
{
};
void main()
{
mystackobject stack1;
}
suppose we are having some member variables like a,b,c
now for the above derived object like myheapobject,mystackobject
where does the member variables stored either in stack or in heap
pls explain me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: Salte {http:#9336733}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Tinchos
EE Cleanup Volunteer