Static function is not associated with class object. So it can be called just with the class name. (without creating the object instance from that class). This is also applicable to static data member.
Nonstatic variables are associated with objects. i.e when instance of object is created from the class, it will have its own copy of non static variable.
Since static function doesnot know object instance, so it cant access the non-static data member.
Given a Calendar class (there are three fields, year, month, day) and a number of N, Implement a function that returns the calendar after N days.
Example: Input: {2017, 3,20} and 12, Output: {2017,4, 1}
While doing design for a software, what things enforce to use template classes and template functions ? Is it consider best practices or not ?