阅读背景:

将对象初始化为子类C ++的实例

来源:互联网 

I wasn't sure how to word what I'm looking for, which is probably why I can't find an answer by searching. Basically, I've got a class with another object as a member, and I want to initialize that member as an instance that is a subclass of that members type. The encapsulating class is called Game, and the member variable is of classtype GameState, and I would like to initialize it as a new instance of MainMenuGameState, which extends GameState.I wasn't sure how to word what I'm looking for,




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: