Posts

Showing posts from September, 2006

standard C++ OOP features (codes)

#include"stdafx.h"

#include <cstdlib>

#include <iostream>



#define OUT



usingnamespace std;



class A

{

private:

int
iMyNum;

void
APrivateFunc()

{



}



public:

A()

{

iMyNum = 100;

}
friend ostream& operator<<( ostream&, A& ) ; //made as friend function for performance reason



void
MyFunc()

{

printf("myfunct");

}

};ostream&operator<<( ostream& o, A& theObj ){ o << "A" << endl; return o ;}



class B : private A

{





public:

B():A()

{

}

int iMyB;