title: cannot access private member declared in class 'Soldier'
body: <p>I'm new to OOP and I do not understand how to pass arguments to classes.</p>
  
  <p>The class' declaration:</p>
  
  <pre><code>class Soldier
  {
      Soldier(int SetHealth, int SetStrength);
  
  private:
      int health;
      int strength;
  
  public:
      void attacked();
      void healed();
      int getHealth();
      int getStrength();
  };
  </code></pre>
  
  <p>Definition of the constructor:</p>
  
  <pre><code>    Soldier::Soldier(int SetHealth, int SetStrength):
          health(SetHealth),
          strength(SetStrength)
      {
  
      }
  </code></pre>
  
  <p>When I try passing arguments to the class it says this:</p>
  
  <pre><code>    1&gt;------ Build started: Project: ConsoleApplication6, Configuration: Debug Win32 ------
      1&gt;  ConsoleApplication6.cpp
      1&gt;c:\users\user\documents\visual studio 2012\projects\consoleapplication6\consoleapplication6\consoleapplication6.cpp(11): error C2248: 'Soldier::Soldier' : cannot access private member declared in class 'Soldier'
      1&gt;          c:\users\user\documents\visual studio 2012\projects\consoleapplication6\consoleapplication6\soldier.h(7) : see declaration of 'Soldier::Soldier'
      1&gt;          c:\users\user\documents\visual studio 2012\projects\consoleapplication6\consoleapplication6\soldier.h(6) : see declaration of 'Soldier'
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>