Похожие чаты

How to do this ques?

10 ответов

19 просмотров

I think it explains pretty clearly step by step how. At what part of it you got stuck?

none- Автор вопроса

Is this correct sol?

none
screenshot Is this correct sol?

You need to give some implementation to play in Game class or do virtual void play() = 0; which makes it "pure virtual", otherwise compiler going to complain about that. Also you need to ideally add public: to the derived classes also. Otherwise it looks correct. If you want to make it a bit more advanced, you can dynamically allocate the games in main function and delete them at the end or use std::unique_ptr<Game>

none- Автор вопроса
Pavel
You need to give some implementation to play in Ga...

Okk sir, compiler didn't complain in my case tho And one more ques why should ideally public be added to derived class? Compiler is not complaining abt it

none
Okk sir, compiler didn't complain in my case tho A...

I think if you don't make it public and try to call play on the derived class (which you don't do in your program but may want to do in reality in some cases) then that won't compile. But I may be wrong

none- Автор вопроса
Pavel
I think if you don't make it public and try to cal...

Yes, when I create a pointer to derived class and try to access play() its showing declared private. Thankyou sir!!

I usually use struct to denote that it's not an OOP S.O.L.I.D. class but just a bunch of data tied together

Nomid Íkorni-Sciurus Lomysz
but it is de facto

well, it can be or not, depending on how you use it

none
screenshot Is this correct sol?

add = 0 after void play() in Games class

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта