-var-创建;无法创建可变对象
我已经尝试制作一个两个包含对象数组的2个对象,两者都是由同一构造函数创建的,但是当我调试一个对象时,一个会得到一个adress,另一个是null。
Player::Player(std::string name) {
this->name = name;
p.setSize(7);
}
那就是带有数组的对象。
Pile::Pile(int size) {
stoneArr = new Stone[size];
this->size = size;
}
Pile::Pile(){
}
那就是播放器内部的对象,由数组组成。
编辑: https://i.sstatic.net/hr1zy.jpg
两者都是无效的,如果您需要更多信息,请让我知道我不介意上传整个项目...
i've trying to make an 2 object which both contains an object array , both are created from the same constructor but when i debug one gets an adress and the other is NULL.
Player::Player(std::string name) {
this->name = name;
p.setSize(7);
}
thats the object with the array.
Pile::Pile(int size) {
stoneArr = new Stone[size];
this->size = size;
}
Pile::Pile(){
}
thats the object inside of player which consists of an array.
EDIT:
https://i.sstatic.net/Hr1ZY.jpg
when i deleted the game instance, both are null, if you need like further info let me know i dont mind upload the whole project...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论