Reputation: 31609
I have this in my .hpp file:
class MD
{
public:
static const int Blk = 0;
}
And this in a method in .mm file that includes the .hpp file:
int i = MD.Blk;
the compiler says error: expected primary-expression before '.' token
on this line.
If I comment it the line out everything works fine.
What am I doing wrong?
Upvotes: 0
Views: 148
Reputation: 69047
The correct way to refer static class member variables is using the ::
operator, like this:
int i = MD::Blk;
Upvotes: 2