I
Ian Lazarus
// why is the error message being generated?
// Microsoft Visual C/C++ 5.0
class Bar
{
public:
void Log(const char* p){ }
};
class Foo : public Bar
{
public:
void Log(int x){ }
};
int main()
{
Foo foo;
foo.Log("foo bar"); // error message below
return(0);
}
// error C2664: 'Log' : cannot convert parameter 1 from 'char [8]' to 'int'
// Microsoft Visual C/C++ 5.0
class Bar
{
public:
void Log(const char* p){ }
};
class Foo : public Bar
{
public:
void Log(int x){ }
};
int main()
{
Foo foo;
foo.Log("foo bar"); // error message below
return(0);
}
// error C2664: 'Log' : cannot convert parameter 1 from 'char [8]' to 'int'