title: I can't figure out C++ syntax error "expected `;' before ‘{’ token"
body: <p>I have this simple code and am getting a syntax error:</p>
  
  <pre><code>file.cc:67: error: expected `;' before ‘{’ token
  file.cc:73: error: expected primary-expression before ‘(’ token
  file.cc:73: error: expected primary-expression before ‘n’
  file.cc:73: error: expected `;' before ‘{’ token
  </code></pre>
  
  <p>I've put stars around the lines that are 67 and 73, which are the constructors for the class. I'm very new to C++ and can't find the syntax issue. This is the first time I've made a constructor.</p>
  
  <pre><code>int main() {
  
    class Patient {
      private: // default is private but stating explicitly here for learning purposes
          std::string name; //object
          int height; //object
          int weight; //object
      public:
          Patient(); //constructor
          Patient(std::string); //constructor
  
          void set_name (std::string n) {name=n;} //fn
          void set_height (int h) {if (height&gt;0){height=h;} else {height=0;}} //fn
          void set_weight (int w) {if (weight&gt;0){weight=w;} else {weight=0;}} //fn
  
          std::string get_name(){return name;} //fn
          int get_height(){return height;} //fn
          int get_weight(){return weight;} //fn
  
          int bmi(void) {
              if ((height!=0) &amp;&amp; (weight!=0))
                return (weight/(height*height));
              else
                return 0;
          }
    };
  
    Patient::Patient () { // **LINE 67**
      name="string";
      height=0,
      weight=0;
    }
  
    Patient::Patient(std::string n) {name=n;height=0;weight=0;} // **LINE 73**
  
    Patient father("Andrew Nonymous");
    Patient mother("Ursula N. Known");
    Patient baby;
  
    //Father's height and weight are unknown.
  
    mother.set_name("Ursula N. Nonymous");
    mother.set_height(1.65);
    mother.set_weight(58);
  
    baby.set_height(0.495);
    baby.set_weight(3.4);
  
    std::cout &lt;&lt; "Baby: " &lt;&lt; baby.get_name() &lt;&lt; " BMI: " &lt;&lt; baby.bmi() &lt;&lt; std::endl;
    std::cout &lt;&lt; "Mother: " &lt;&lt; mother.get_name() &lt;&lt; " BMI: " &lt;&lt; mother.bmi() &lt;&lt; std::endl;
    std::cout &lt;&lt; "Father: " &lt;&lt; father.get_name() &lt;&lt; " BMI: " &lt;&lt; father.bmi() &lt;&lt; std::endl;
  
    return 0;
  }
  </code></pre>