I wrote the following code
[code=cpp]
#include <map>
#include<iostre am>
using namespace std;
//typedef map<int,int> Maps;
class A
{
public:
typedef map<int,int> Maps;
private:
Maps *m_MapP;
public:
Maps* getMapP();
int* getIntP();
};
Maps* A::getMapP()
{
return m_MapP;
}
int* A::getIntP()
{
return NULL;
}
int main()
{
return 0;
}
[/code]
When i compile this i am getting compiler error in the method definition of getMapP.
But when i move the typedf declaration above the class then it is working fine.
I cant figure out why this is happeneing.
can somebody comment on this.
Thanks
Raghuram
[code=cpp]
#include <map>
#include<iostre am>
using namespace std;
//typedef map<int,int> Maps;
class A
{
public:
typedef map<int,int> Maps;
private:
Maps *m_MapP;
public:
Maps* getMapP();
int* getIntP();
};
Maps* A::getMapP()
{
return m_MapP;
}
int* A::getIntP()
{
return NULL;
}
int main()
{
return 0;
}
[/code]
When i compile this i am getting compiler error in the method definition of getMapP.
But when i move the typedf declaration above the class then it is working fine.
I cant figure out why this is happeneing.
can somebody comment on this.
Thanks
Raghuram
Comment