title: C++ Printing value of pointer gives strange result
body: <p>When I compile and run this C++ code, I am not getting the output I expected.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      int * i = new int;
      long * l = new long;
      char * c = new char[100];
      float * f = new float[100];
  
      cout &lt;&lt; "i " &lt;&lt; i &lt;&lt; endl;
      cout &lt;&lt; "l " &lt;&lt; l &lt;&lt; endl;
      cout &lt;&lt; "c " &lt;&lt; c &lt;&lt; endl;
      cout &lt;&lt; "f " &lt;&lt; f &lt;&lt; endl;
  
  
      delete i;
      delete l;
      delete []c;
      delete []f;
  
      cin.get();
      return 0;
  }
  </code></pre>
  
  <p>On a unix machine I get</p>
  
  <pre><code>i 0x967f008
  l 0x967f018
  c
  f 0x967f090
  </code></pre>
  
  <p>On a windows machine the value for c prints as over a line of random characters.</p>
  
  <p>Please can someone explain why it's not printing the pointer for the char array correctly.</p>
  
  <p>Thanks</p>