I had the following C ++ code, where the argument of my constructor in the declaration had a different constant than the definition of the constructor.
class testClass {
public:
testClass(const int *x);
};
testClass::testClass(const int * const x) {}
I was able to compile this without warning using g ++, should this code compile, or at least give some warnings? It turns out that the built-in C ++ 64-bit compiler Solaris gave me a linker error, this is how I noticed that the problem was.
What is the rule for matching arguments in this case? Is this for compilers?
Miket source
share