- 論壇徽章:
- 7
|
#include <stdio.h>
class test
{
public:
bool decode(int *p, int len, int *pret = NULL);
private:
bool decode(int *p, int len, int *pret = NULL, int *ret = NULL);
};
bool test::decode(int *p, int len, int *pret) {
return false;
}
bool test::decode(int *p, int len, int *pret, int *ret) {
return false;
}
int main()
{
test x;
int p = 1;
int len = 1;
int xs;
printf("%d\n", x.decode(&p, len, &xs));
return 0;
}
g++ test.cpp
錯(cuò)誤:對(duì)重載的‘decode(int*, int&, int*)’的調(diào)用有歧義
這是為啥,這個(gè)該如何處理? |
|