I have the following hierarchic connection :
Father : Product
Son : Music
inner Class within Music called Node
Now,in main , when I declare the following :
Product *album = new Music(.....);
I have a method called "addSongsToAlbum(.........)" .
However ,I cannot call 'addSongsToAlbum' with the pointer 'album' , i.e. :
because 'album' is a Product pointer , and I must do that using downcasting , meaning :
The problem is ,my lecturer doesn't allow me using that concept (he says it's bad programming) ,
so , is there something else that I can do except putting 'addSongsToAlbum' in the Father 'Product' and inherit
the method from that Father ?
thanks in advance,Ron
This post has been edited by passer_by: 29 April 2011 - 03:18 AM