title: How can you print integers from a class
body: <p>This seems like a simple thing to me, but I have an entity class:</p>
  <pre><code>class Entity
  {
  private:
      std::string m_Name;
  public:
      int x = 0, y = 0;
  
      Entity() : m_Name(&quot;Undefined Entity&quot;) {
          std::cout &lt;&lt; m_Name &lt;&lt; &quot; Created!\n&quot;;
      }
      Entity(const std::string&amp; name) : m_Name(name) {
          std::cout &lt;&lt; m_Name &lt;&lt; &quot; Created!\n&quot;;
      }
  
      ~Entity() {
          std::cout &lt;&lt; m_Name &lt;&lt; &quot; Destroid\n&quot;;
      }
  
      const std::string GetName() { return m_Name; }
  
      void PrintCords() { std::cout &lt;&lt; x &lt;&lt; ' , ' &lt;&lt; y &lt;&lt; '\n'; }
  };
  </code></pre>
  <p>and in my main function I run the PrintCords function:</p>
  <pre><code>int main(void)
  {
      std::unique_ptr&lt;Entity&gt; j = std::make_unique&lt;Entity&gt;(&quot;Jeff&quot;);
      std::cout &lt;&lt; j-&gt;GetName() &lt;&lt; '\n';
      j-&gt;PrintCords();
  }
  </code></pre>
  <p>Yet, when I run the program, I get seemingly random numbers:
  <code>021084480</code></p>