**For classes in C++**: I don't understand when I should create private member variables and functions,
I know that they can't be called from int main whereas public members can but I have no clue when I should define something as private and what the benefit is.

Can someone explain with a sample code what the advantage of using private members is and why it is useful? (does it prevent users from changing code that you made? how is this useful)?