Problem creating classes in cpp
I was following the c++ tutorial step by step, and I created, in separated files, the MyClass that takes two integer arguments. And I had the idea to make a similar one, but one taking strings for arguments. Here is the header: #ifndef PENDORCHO_H #define PENDORCHO_H class Pendorcho { public: Pendorcho (string x); void setName(string x); string getName(); protected: private: const string name; }; #endif // PENDORCHO_H And here is the source: #include "Pendorcho.h" #include <iostream> using namespace std; Pendorcho::Pendorcho (string x) : name(x) { cout << "Merenguete" << "\n"; } Pendorcho::setName(string x) { name = x; } Pendorcho::getName() { return name; } This is my main: int main() { Pendorcho obj1("Mingo"); obj1.getName(); obj1.setName("Mariela"); obj1.getName(); return 0; } When I try to run it I get this error in the header file: Line 8: error: expected ')' before 'x'. I don't know why I should close de parenthesis before the x, but I tried it and has no better result. What am I doing wrong?