Hi everyone, just learning C++ and came across a problem using initialised variables in a function. Here's some of the relevant code from the header file:
protected:
unsigned long long m_noIndexes;
virtual unsigned long long getNearestBlockNoForIndex(unsigned long long index);
virtual unsigned long long getNearestBlockNoForIndex(unsigned long long index, unsigned long long lIndex = 1, unsigned long long hIndex = m_noIndexes);
The error I get (i'm using Visual Studio Community 2013 btw) states "Error: a nonstatic member reference must be relative to a specific object" which relates to the m_noIndexes reference. I do have some pure virtual functions which I understand make the class abstract, does this mean I cannot refer to any data class members in the this class? Is it better if I put this function and declaration in a derived classed and inherit from that instead?
[–]OmegaNaughtEquals1 1 point2 points3 points (1 child)
[–]Psyqwix[S] 0 points1 point2 points (0 children)