S
smilesonisamal
class A
{
public:
void SetA(EmployeeCategory a); // EmployeeCategory is a enum
and is already declared.
EmployeeCategory GetA() const;
private :
EmployeeCategory m_emplCategory; // This is initialized in the
constructor
}
In .cpp file
--------------
EmployeeCategory A::GetA() const
{
return m_emplCategory;
}
Set function works fine. But when I try to return a value for enum I
get the following error:
error C2511: ' EmployeeCategory A::GetA() const' : overloaded member
function not found in 'A'
I dont understand why this problem comes.
The following code works:
A: GetA(EmployeeCategory *eCat)
{
*eCat = m_emplCategory;
}
Is this a bug in the Visual Studio or I am missing anything?
Regards
Soni
{
public:
void SetA(EmployeeCategory a); // EmployeeCategory is a enum
and is already declared.
EmployeeCategory GetA() const;
private :
EmployeeCategory m_emplCategory; // This is initialized in the
constructor
}
In .cpp file
--------------
EmployeeCategory A::GetA() const
{
return m_emplCategory;
}
Set function works fine. But when I try to return a value for enum I
get the following error:
error C2511: ' EmployeeCategory A::GetA() const' : overloaded member
function not found in 'A'
I dont understand why this problem comes.
The following code works:
A: GetA(EmployeeCategory *eCat)
{
*eCat = m_emplCategory;
}
Is this a bug in the Visual Studio or I am missing anything?
Regards
Soni