All pastes #22273 Raw Edit

Stuff

public cpp v1 · immutable
#22273 ·published 2005-09-07 05:14 UTC
rendered paste body
#include <iostream>#include <string> using namespace std; class father{protected:        char *name;public:        father(const char *nom)        {                strcpy(name,nom);        }        char *GetName() { return name; }        virtual void print() { cout<<"Father "<<nombre<<endl; }};  class son: public padre{public:        son() : father("Son") {}        void print() { cout<<"Not defined"<<endl; }};   int main(){        father P("J Ruiz");        P.print();        cout<<P.GetName()<<endl;        return 0;}