title: How to use a class object in C++ as a function parameter
body: <p>I am not sure how to have a function that receives a class object as a parameter. Any help? Here is an example below.</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  void function(class object); //prototype
  
  void function(class tempObject)
  {
     //do something with object
     //use or change member variables
  }
  </code></pre>
  
  <p>Basically I am just confused on how to create a function that will receive a class object as its parameters, and then to use those parameters inside the function such as <code>tempObject.variable</code>.</p>
  
  <p>Sorry if this is kind of confusing, I am relatively new to C++.</p>