I developing a text-game, and one of the problems I foresee is how do I make a set of a user-defined classes.
The classes are inherited from the class 'Item', and could be identified from each other from a 'short' variable.
The question is that how do I make it so that that find function would work, because I do not know how to return a value from a class.
Just google "object oriented programming C++" and you'll pretty much get everything you want.
TS, before you delve into Object Oriented Programming you need to understand Object Oriented relationships.
The first thing you should do is create a "user story" that defines everything your program consists of.
Then you should separate the nouns and the verbs, but be sure to group the verbs with the corresponding nouns.
The nouns become your classes and the verbs that correspond to the nouns become their methods.
Then you need to define the relationships.
Does a noun have another noun?
"An Employee has a Resume" - Employee is a class that contains a Resume class
Is a noun a special instance of another noun?
"A Manager is an Employee" - Manager is a class that inherits an Employee class
That is my lesson in OOP for today.