You can't dynamically create Game, give me a second
Games *obj[3]; // array of 3 unitialized pointers to Game obj[0] = new Cricket(); // dynamically allocate the first game and assign the pointer to the first item of the array ... obj[0]->play(); // same as before ... delete obj[0]; // delete the first game object to avoid memory leak ...
Replace the first line by Games *obj[3];
Do you really want to get permanently banned for this?
I haven't seen the message, I stop sending messages
alright, i'll remove your 2nd warn.
If you want to help, help with recent messages
Обсуждают сегодня