title: Variable type for an object
body: <p>I am new to C++ and I was playing around with encapsulation of objects. My problem arises when I try to make an object that can take another object into the constructor.<br>
  I am not sure what type of value I should give the variable when I initially assign it at the top of the object. I tried <code>void</code> and <code>int</code> but neither seem to work. here is my code:</p>
  
  <pre><code>class NewTest {
      int value;
  public:
      NewTest() {
          value = 5;
      }
  
      int return_value() {
          return value;
      }
  };
  
  class OuterTest {
      int object;
  public:
      OuterTest(int input) {
          object = input;
      }
  
      int return_object_value() {
          cout &lt;&lt; object.return_value() &lt;&lt; '\n';
      }
  };
  
  int main() {
      NewTest test_new;
      OuterTest outer_new(int test_new);
      outer_new.return_object_value();
      return 0;
  }
  </code></pre>