I am a newbie to CPP and I am practicing inheritance. I think I got something wrong with the syntax but I couldn't tell the reason.Here is part of my code:
#include<iostream>
using namespace std;
class Clown{
public:
string name ;
void dance();
Clown(string s) {name = s;}
};
class CircusClown: public Clown{
public:
string name;
void dance();
CircusClown(string s){name = s;}
};
I think something wrong with my inherited class.
am using Mac so there is something wrong with displaying but here is the error:
Clowns.cpp: In constructor â:
Clowns.cpp:18: error: no matching function for call to â
Clowns.cpp:8: note: candidates are: Clown::Clown(std::string)
Clowns.cpp:4: note: Clown::Clown(const Clown&)