Code:
#include <iostream>
#include <string>
using namespace std;
class parent{
protected:
int age;
public:
//setter
void setValues(int Age) { age=Age; }
//getter
int getAge() { return age; }
//methods
void talk() { cout<<"I am the parent, shuttup a your face! "<<endl; }
};
class son:public parent{
private:
int number;
public:
void talk() { cout<<"Hi my name in John, i am the son. "<<endl; }
son(int a) { number = a; }
};
int main () {
son john(0);
}
Ok i figured it out and it makes sense to me now but i'll have to play around with this method for a few days just to let the whole process sink in, thank guys!