like data members are created where the object is created (Each object has its unique data members) and member functions(which is code, not a data) are stored in code memory section and it is common for all the other objects. Now my question is, where does the object and the variables that is created in the member function is stored. example:
class A
{
int a,b;
public:
void foo(int x,int y)
{
a=x;
b=y;
A obj_1;
}
};
int main()
{
A obj;
obj.foo(1,2);
return 0;
}
are these object(obj_1) and the variables(x,y) stored where the obj is or anywhere else.
Hoping for your answers guys. thanks in advance!
searched on google and youtube too, but didn't get the answer that i want. if anyone knows, help me to get this.