Hello.
I previously had a program that compiled and worked with no error.
Relevant parts here:
class BasicList{
public:
char* listLookup() {
item = buffer;
...
return something;
}
protected:
char* item;
char buffer[128];
...
}
Now I try to make it const correct so I changed it to be this with the
const and mutable keywords:
class BasicList{
public:
char* listLookup() const{
item = buffer;
...
return something;
}
protected:
mutable char* item;
char buffer[128];
...
}
Now when I compile, I get an error at the assignment line
(item=buffer), saying invalid conversion from 'const char*' to
'char*'. I don't really understand why this error occurs, when it
didn't before the method was const. Why? and how to fix?
Your help is appreciated.
thank you!