C++相談室 part39
■ このスレッドは過去ログ倉庫に格納されています
0793デフォルトの名無しさん
NGNG整式の加減乗除のプログラムを(趣味で)作っているのですが、
class poly
{
private:
int max_dim;
double* coefficients;
public:
/* 中略 */
poly& operator=(const poly& x);
/* 以下略 */
};
/* 中略 */
poly& poly::operator=(const poly& x)
{
/* 代入処理 */
return (*this);
}
とすると、
poly.cc: In member function `poly& poly::operator=(const poly&)':
poly.cc:59: error: passing `const poly' as `this' argument of `int
poly::getdim()' discards qualifiers
というエラーメッセージが出てしまうのですが、どう解決したらよいか分かりません。
よろしくお願い致しますm(_ _)m
■ このスレッドは過去ログ倉庫に格納されています