G
Gernot Frisch
I want to have a class that provides 2 methods with the same name
(do1, do2) that cann be called from a function (Fkt) but Fkt does not
know/care about it's type.
class base
{
public:
virtual void Do(base& b)=0;
};
class do1ublic base
{
public:
void Do(base& d) {printf("%d", (do1)d.magic);}
long magic;
};
class do2ublic base
{
public:
void Do(base& d) {printf("%d", (do1)d.othermagic);}
long othermagic;
};
void Fkt(base& cl)
{
cl.Do(cl);
}
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
(do1, do2) that cann be called from a function (Fkt) but Fkt does not
know/care about it's type.
class base
{
public:
virtual void Do(base& b)=0;
};
class do1ublic base
{
public:
void Do(base& d) {printf("%d", (do1)d.magic);}
long magic;
};
class do2ublic base
{
public:
void Do(base& d) {printf("%d", (do1)d.othermagic);}
long othermagic;
};
void Fkt(base& cl)
{
cl.Do(cl);
}
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com