You said the function returns just a single character yet you are trying to return a character array. You can't have it both ways. What you should have done is
char* getEmpName()const
-- notice there is a * after char to indicate it will return an array of characters.
Hi, sorry to calling back to life this old post, but I still get error even if I tried to do as you said. I have a declaration in a class which is
class Bla{
private:
char date[9];
public:
char* ReturnDate(const Bla& blabla);
};
char* Bla::ReturnDate(const Bla& blabla);{
return blabla.date;
}
The error is this
error C2440: 'return' : cannot convert from 'const char [9]' to 'char*'