title: In C++, can I make cout display doubles as doubles but without touching main()?
body: <p>quite a specific question but I'm working on an assignment in which I have to use some operator overloads to manipulate some coordinates. The coordinates are doubles but C++ just outputs them as <code>(1,4)</code> when they're <code>(1.0,4.0)</code> as they're integers.</p>
  <p>I've seen that I can use <code>std::cout.precision</code> to force <code>cout</code> to work to 1dp but I'm also not supposed to touch <code>main()</code> at all in my code.</p>
  <p>Could anyone suggest another way?</p>
  <pre class="lang-cpp prettyprint-override"><code>ostream&amp; operator&lt;&lt;(ostream&amp; OutStream, const Coord&amp; Coordinate)
    {
     OutStream &lt;&lt; &quot;(&quot; &lt;&lt; Coordinate.X &lt;&lt; &quot;,&quot; &lt;&lt; Coordinate.Y &lt;&lt; &quot;)&quot;;            
     return OutStream;
    }
  </code></pre>