M
Maciej Kwapulinski
Halo
I have a problem with the following program:
#include <stdlib.h>
struct Base {
int a;
Base() {
a=0;
}
Base(int a): a(a) {};
};
class InherInher;
struct Inher: public Base {
Inher(int a): Base(a) {};
// this is the problem
struct Base* getObj() {
Base *ptr = new InherInher( a );
return ptr;
}
};
struct InherInher: public Inher {
InherInher(int a): Inher( a ) {};
};
main() {
}
Have You got any ideas how to make it work
Greetings
Maciej
I have a problem with the following program:
#include <stdlib.h>
struct Base {
int a;
Base() {
a=0;
}
Base(int a): a(a) {};
};
class InherInher;
struct Inher: public Base {
Inher(int a): Base(a) {};
// this is the problem
struct Base* getObj() {
Base *ptr = new InherInher( a );
return ptr;
}
};
struct InherInher: public Inher {
InherInher(int a): Inher( a ) {};
};
main() {
}
Have You got any ideas how to make it work
Greetings
Maciej