Thursday, January 18, 2007

C++ Pure Virtual Functions

Can C++ Pure Virtual Functions can't have implementation ? The Answer is yes.

#include
using namespace std;

class A {
public:
virtual void display()=0;
};
void A::display() {
cout<<"A::display"<<endl;
}

class B : public A {
public:
void display() {
A::display();
cout<<"B::display"<<endl;
}
};

int main() {
B b;

cout<<"hello world"<<endl;
b.display();
return 0;
}

Yesterday, I went to Chennai Book Fair - 2007 with Sankar. I bought "Ke. Mu. Ke. Pe" by Madhan, "Bharathiyar Poems", "48 Laws of Power" by Richard Greene. I'm currently reading "Unlimited Power" by Anthony Robbins, here are the Commodities of the King.
* Passion for Excellence
* Belief that you can succeed
* Strategy for Excellence
* Clarity of Values
* Energy to Persist
* Bonding with others
* Mastery of Communication (Both Self and others)

No comments: