title: Writing a program to print a "Hello, world!" program
body: <p>I just started reading Accelerated C++ and I'm trying to work through the exercises when I came across this one:</p>
  
  <p><code>0-4. Write a program that, when run, writes the Hello, world! program as its output.</code></p>
  
  <p>And so I came up with this code:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      cout &lt;&lt; helloWorld &lt;&lt; endl;
  
      cin.get();
      return 0;
  }
  
  void helloWorld(void)
  {
      cout &lt;&lt; "Hello, world!" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I keep getting the error <code>'helloWorld' : undeclared identifier</code>. What I figured I was supposed to do is make a function for helloWorld then call that function for the output, but apparently that's not what I needed. I also tried putting <code>helloWorld()</code> in main, but that didn't help either. Any help is greatly appreciated.</p>