say if i had one header file that defined all the function prototypes and global variables for each class..
something like
Code:
//blah.h
#ifndef _blah_h
#define _blah_h
class blah1 {
public:
int b1();
int b2();
private:
int b;
};
class blah2 {
public:
int b3();
int b4();
};
class blah3 : public blah2 {
public:
int b5();
};
#endif
does this appear correct ?
if it is correct then in my blah.cpp file where i go to actually implement these functions how would it look?
somedthing like...
Code:
//blah.cpp
#include "blah.h"
int b1() {
return 1;
}
int b2() {
return 2;
}
int b3() {
return 3;
}
int b4() {
return 4;
}
int b5() {
return 5;
}
and if that is correct, then what about when im using inheritance but the i would like to re-write a function how would it know if im calling the parents implementation of a function or a subclass'es implemetation of that function?
thanks