相关疑难解决方法(0)

奇怪的C++错误:test.cpp:15:错误:将'const*'作为'*'的'this'参数传递丢弃限定符

我在使用特定的代码时遇到了一些问题,如果有人能够就此问题启发我,我将非常感激,我已经在以下示例中将问题排除在外:

#include <iostream>

using namespace std;

class testing{
   int test();
   int test1(const testing& test2);
};

int testing::test(){
   return 1;
}

int testing::test1(const testing& test2){
   test2.test();
   return 1;
}
Run Code Online (Sandbox Code Playgroud)

那么可能导致以下错误:

test.cpp:15:错误:将'const testing'作为'int testing :: test()'的'this'参数传递,丢弃限定符

非常感谢!

c++ compiler-errors const

43
推荐指数
2
解决办法
3万
查看次数

标签 统计

c++ ×1

compiler-errors ×1

const ×1