Hi, I have a base class something like:
And I would like my derived classes to initialize the 'const int nRecords' value in their constructor, i.e.Code:class MyClass { protected: const int nRecords; int *records; public: ... };
When I try to compile such code however, I get the follwing error (using DevC++ v4.x):Code:class MyDerivedClass : public MyClass { public: MyDerivedClass() : nRecords(10) {} ... }
Any suggestions as to how I could work around this?"Class 'MyDerivedClass' does not have any field named 'nRecords'"
dt