title: How to store the state of an object without using global variables in c++
body: <p>I'm new to C++ and while learning i came across a lot of places which say that using global variables should be avoided and used in very rare cases.</p>
  
  <p>My question is, How can i store the state of an object so then it can be accessed at a later time without using global variables?  Here's an example:</p>
  
  <p>A Circle class may have its state stored by using diameter, x and y as globals.  Then these values can be modified and retrieved with methods.</p>
  
  <p>Is there a way to accomplish the above without using globals that is preferred?</p>
  
  <p>Thanks</p>
  
  <p>Edit:
  I had globals confused with member variables and that was the problem.  Now i feel really stupid for asking this question but hopefully this will help someone else.</p>