I'm working on a project for school and am running into some problems I would like to have answered. I recently asked a question here about the same project and got that problem solved but am now facing another problem that I don't have the knowledge to fix. So I'm here asking again what I should do.
I created a template class that holds a fixed length string where the template argument is the length of the string and now I'm trying to inherit from the template class to make a string that only accepts digits and is a fixed length. My problem is that I can't get the class definition to work correctly. When I don't make the new class a template like this:
class DigitStr: public FixedStr<N>
It says that N is an undeclared identifier. However when I make it a template like this:
template <int N>
class DigitStr: public FixedStr<N>
Then none of the methods work correctly and give either an undeclared identifier or requires template argument. The ways I've tried writing the constructors were:
DigitStr::DigitStr ()
and
DigitStr<N>::DigitStr ()
So does anyone see the problem here? Any help would be greatly appreciated.