title: error: expected unqualified-id before 'void'
body: <p>I have just started learning c++. I am trying to play with classes and objects in this code. The code is simply about taking the data contents of an array from the user and then as an output show the data contents of the array back.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class array
  {
      public:
      int ar[5];
  
      void putData();
      void disp();
  }
  
  
  array :: void putData()
  {
      for(int i=0;i&lt;5;i++)
      {
          cin&gt;&gt;ar[i];
      }
  }
  
  array :: void disp()
  {
      for(int i=0;i&lt;5;i++)
      {
          cout&lt;&lt;ar[i];&lt;&lt;endl;
      }
  }
  
  int main()
  {
      array m;
      m.putData();
      m.disp();
      return 0;
  }
  </code></pre>