title: c++ Function Definition does not declare parameters
body: <p>I am getting compile errors in my C++ project. On my friend's computer I get no errors but on mine I get the following:</p>
  
  <p>On line 129 - <code>"Function Definition does not declare parameters "</code></p>
  
  <p>On line 137 - <code>"'seats' was not declared in this scope"</code></p>
  
  <p>I am running Code::blocks 10.05 on Windows 7.</p>
  
  <p>Here is my code (with line numbers indicated by comments):</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Seat.h"
  using namespace std;
  
  
  
  class Plane
  {
  public:
      int viewSeat(int sNum) {
          if (seats[sNum].isFree()) {
              return 0;
          } else {
              //cout &lt;&lt; "Debug (Plane::viewSeat(sNum) called)";
              string seatMess = "";
              switch (seats[sNum].getState()) {
                  case 1:
                      seatMess = " is reserved for ";
                      break;
  
                  case 2:
                      seatMess = " has been checked in by ";
                      break;
              }
              cout &lt;&lt; "(X) Seat ";
              cout &lt;&lt; seats[sNum].getCode();
              cout &lt;&lt; seatMess;
              cout &lt;&lt; seats[sNum].getFName() &lt;&lt; " " &lt;&lt; seats[sNum].getLName() &lt;&lt; "\n";
              return 1;
          }
      }
  
  
      void viewAll() {
          for (int x = 0; x &lt; numOfSeats; x++) {
              if ((seats[x].getState() == 0)) {
                  cout &lt;&lt; "Seat " &lt;&lt; seats[x].getCode() &lt;&lt; " is free\n";
              } else {
                  viewSeat(x);
              }
          }
      }
  
      void viewFree() {
          int freeSeats = 0;
          for (int x = 0; x &lt; numOfSeats; x++) {
              if ((seats[x].getState() == 0)) {
                  cout &lt;&lt; "Seat " &lt;&lt; seats[x].getCode() &lt;&lt; " is free\n";
                  freeSeats++;
              }
          }
          cout &lt;&lt; "Found " &lt;&lt; freeSeats &lt;&lt; " free seats\n";
      }
  
      void freeSeat(int sNum) {
          seats[sNum].emptySeat();
      }
  
      string getCode(int sNum) {
          return seats[sNum].getCode();
      }
  
      int reserveSeat(int sNum, string fName, string lName, int age, int cType, string business = "") {
          if (seats[sNum].isFree()) {
              seats[sNum].setFName(fName);
              seats[sNum].setLName(lName);
              seats[sNum].setAge(age);
              seats[sNum].setType(cType);
              seats[sNum].setState(1);
              seats[sNum].setBusiness(business);
              return 1;
          } else {
              return 0;
          }
      }
  
      int checkSeat(string lName, string seatCode) {
          int found = 0;
          for (int x = 0; x &lt; (sizeof(seats) / sizeof(Seat)); x++) {
              if ((seats[x].getCode() == seatCode) &amp;&amp; (seats[x].getLName() == lName)) {
                  found = 1;
                  seats[x].setState(2);
                  return 1;
              }
          }
          return 0;
      }
  
      int calcTake() {
          int seatPrice = 5;
          int totalTake, totalSeats = 0, totalWestern = 0, totalBusiness = 0, totalStandard = 0;
          for (int x = 0; x &lt; numOfSeats; x++) {
              if ((seats[x].getState() != 0)) {
                  int cType = seats[x].getType();
                  int thisSeat;
                  if (cType == 1) {
                      // discount for western`
                      thisSeat = 0.75 * seatPrice;
                      totalWestern++;
                  } else if (cType == 2) {
                      // discount for business
                      thisSeat = 0.8 * seatPrice;
                      totalBusiness++;
                  } else {
                      thisSeat = 0.95 * seatPrice;
                      totalStandard++;
                  }
                  totalTake = totalTake + thisSeat;
                  totalSeats++;
              }
          }
  
  
          return totalTake;
      }
  
      int isFree(int sNum) {
          if (seats[sNum].isFree()) {
              return 1;
          } else {
              return 0;
          }
      }
  
  
  
  private:
  
      // Line 129 ("Function Definition does not declare parameters"):
  
      Seat seats[32] { {"1A"}, {"1B"}, {"1C"}, {"1D"},
          {"2A"}, {"2B"}, {"2C"}, {"2D"},
          {"3A"}, {"3B"}, {"3C"}, {"3D"},
          {"4A"}, {"4B"}, {"4C"}, {"4D"},
          {"5A"}, {"5B"}, {"5C"}, {"5D"},
          {"6A"}, {"6B"}, {"6C"}, {"6D"},
          {"7A"}, {"7B"}, {"7C"}, {"7D"},
          {"8A"}, {"8B"}, {"8C"}, {"8D"}
      };
  
      // Line 137 ("'seats' was not declared in this scope"):
  
      int numOfSeats = sizeof(seats) / sizeof(Seat);
  };
  </code></pre>