gpt4 book ai didi

c++ - 错误 C2582 : 'operator =' function is unavailable in

转载 作者:行者123 更新时间:2023-11-30 04:15:12 24 4
gpt4 key购买 nike

我有课,

class Points
{
public:
Points();
}

还有一个,

class OtherPoints : public Points
{
public:
OtherPoints ();

Points myPoints;
}

现在在 OtherPoints() 构造函数中,我正在尝试创建一个 Point 变量,例如,

OtherPoints::OtherPoints(){ 
myPoints=Points();
}

得到错误,

error C2582: 'operator =' function is unavailable in 'Points'

最佳答案

我认为不需要myPoints=Points();;

Points myPoints; // This code has already called the constructor (Points();)

关于c++ - 错误 C2582 : 'operator =' function is unavailable in,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18455762/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com