Member pointer selector issues
Hi,
I've never actually used ->* or .* before, and I decided that I would experiment with them just to see if I understand how they work. The code below, however, does not compile:
Code:
class MyFoo
{
public:
int* m_something;
};
void FooTest()
{
MyFoo* fooobj = new MyFoo;
fooobj->*m_something = 5;
}
It fails with:
error C2065: 'm_something' : undeclared identifier
I read the C++03 standard on these operators just to make sure I have the concept down. From what I understand, ->* is supposed to be the same as:
Code:
*(fooobj->m_something) = 5;
Why is this not working? I'm afraid it's something horribly obvious, so go easy on me
Thanks in advance for help.
--MrDoomMaster
--C++ Game Programmer
Don't forget to rate me if I was helpful!