
Keith B. answered 03/01/20
Software Engineer and Math Geek
This sounds like a homework assignment - are you having trouble with the static class member? A static class member is the member of all instances of an object. You declare it in the class, same as any other member, but with the static keyword. You must then declare an instance of the member, where it can be instantiated. Usually this is done in the .cpp file of the same name as the .h file.
header file:
class file:
Static functions are similar to regular functions, only they can be called without instantiating an instance of the class object:
In main, you can get the reference the static function like so:
Hope this helps your assignment.