Let's suppose I have two classes, Tom and Jerry, both inerithing from a mother class Mother.
Is the following piece of code correct ?
Mother* m;
if (x == a) {
m = new Tom();
}
else if (x == b) {
m = new Jerry();
}
I thought it was not correct, but it seems to me to work.
Thanks a lot Gaminic !
Now I understand this piece of code.