Is it possible to create a class within another class? Is treating my class declaration as a member function. Here is my code:
struct Handler{
int *_value = nullptr;
Handler(int& value)
{
_value = &value;
}
};
struct action{
int _value = 0;
Handler handler(_value);
};
So I want the _value
in the struct Handler have the same adress with the _value
in struct action, so when I change one of them, the other one will have the same value.