When you run the program it prints out the same number twice and it seems like the constructor number doesn't decrease which is 100. Just run it it prints out 98 twice. I have no idea why the 100 just don't decrease at all please tell me why thanks.
That statement doesn't change money because changing the money requires the assignment operator.
like:
money = money - element;
From what you have been posting, I think that it is likely that you have jumped into classes too soon without even understanding functions. I would suggest that you practice essentials more and get a better understaning before trying to learn classes. Especially, learn more about functions and do some practice.
> q.buysomething(&q,o);
a member function of a class receives as a hidden parameter the memory address of the object that effectuates the call (the this pointer)
So passing yourself that memory address is error prone and unnecessary