title: C++ no matching function for call to error
body: <p>I am trying to simulate a certain game as an exercise (dont ask me which, you will know if you know the game), however, I just learnt objects and class on the internet and the whole thing is still so confusing to me. The following is a section of my code that is giving me an error.</p>
  
  <p>The error I have is:</p>
  
  <pre><code>C:\Users\N\Desktop\Untitled1.cpp    In constructor 'ekop::Moveset::Moveset()':
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Error] no matching function for call to 'Move::Move()'
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidates are:
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(std::string, int, int, int)
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 4 arguments, 0 provided
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(const Move&amp;)
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 1 argument, 0 provided
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Error] no matching function for call to 'Move::Move()'
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidates are:
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(std::string, int, int, int)
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 4 arguments, 0 provided
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(const Move&amp;)
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 1 argument, 0 provided
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Error] no matching function for call to 'Move::Move()'
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidates are:
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(std::string, int, int, int)
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 4 arguments, 0 provided
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(const Move&amp;)
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 1 argument, 0 provided
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Error] no matching function for call to 'Move::Move()'
  56  9   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidates are:
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(std::string, int, int, int)
  14  3   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 4 arguments, 0 provided
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] Move::Move(const Move&amp;)
  11  7   C:\Users\N\Desktop\Untitled1.cpp    [Note] candidate expects 1 argument, 0 provided
  C:\Users\N\Desktop\Untitled1.cpp    In constructor 'ekop::ekop()':
  52  12  C:\Users\N\Desktop\Untitled1.cpp    [Note] synthesized method 'ekop::Moveset::Moveset()' first required here
  </code></pre>
  
  <p>I don't know what went wrong, the code is below.
  Don't tell me not to use <code>using namespace std;</code>, I know I am not supposed to do that but I am not going to fix that in this program.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;fstream&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  #include &lt;stdio.h&gt; /* printf, scanf, puts, NULL */
  #include &lt;stdlib.h&gt; /* srand, rand */
  #include &lt;time.h&gt; /* time */
  using namespace std;
  
  class Move
  {
      public:
          Move(string a, int b, int c, int d)
          {
              name = a;
              type_num = b;
              power = c;
              accuracy = d;
          }
  
          void setName (string a)
          {
              name = a;
          }
  
          void setType_num(int a)
          {
              type_num = a;
          }
  
          void setPower(int a)
          {
              power = a;
          }
  
          void setAccuracy(int a)
          {
              accuracy = a;
          }
  
      private:
          string name, type;
          int type_num, power, accuracy;
  };
  
  class ekop
  {
      public:
          ekop()
          {
              Moveset moveset;
          }
  
      private:
          class Moveset
          {
              public:
                  //constructor
                  //retrievors
              private:
                  Move slot1, slot2, slot3, slot4;
          };
  };
  
  int main()
  {
      //lines of code
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>edit 1: I had this constructor for the class Moveset, but since it didnt affect the error when I took it out, so I didnt include that in the post just now.</p>
  
  <pre><code>Moveset()
                  {
                      slot1.setName("MOVE 1");
                      slot1.setType_num(rand()%18);
                      slot1.setPower(10*(rand%15+1));
                      slot1.setAccuracy(5*(rand%11+10));
                      //repeat for the rest of the slots
                  }
  </code></pre>
  
  <p>edit 2:
  Now if I do this instead:</p>
  
  <pre><code>        //No change before this
          class Moveset
          {
              public:
                  //constructor
                  //retrievors
              private:
                  Move slot1("MOVE 1", rand() % 18, 10*(rand % 15 + 1), 5 * (rand % 11 + 10)),
                       slot2("MOVE 2", rand() % 18, 10*(rand % 15 + 1), 5 * (rand % 11 + 10)), 
                       slot3("MOVE 3", rand() % 18, 10*(rand % 15 + 1), 5 * (rand % 11 + 10)),
                       slot4("MOVE 4", rand() % 18, 10*(rand % 15 + 1), 5 * (rand % 11 + 10));
          };
  };
  
  //no change after this
  </code></pre>
  
  <p>I get this error instead:</p>
  
  <pre><code>62  16  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected identifier before string constant
  62  16  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected ',' or '...' before string constant
  63  16  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected identifier before string constant
  63  16  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected ',' or '...' before string constant
  64  13  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected identifier before string constant
  64  13  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected ',' or '...' before string constant
  65  13  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected identifier before string constant
  65  13  C:\Users\N\Desktop\Untitled1.cpp    [Error] expected ',' or '...' before string constant
  </code></pre>