Hello, me and my partner recently started learning C++. We have been learning from the following book : C++ Programming in easy steps by Mike McGrath : we are having a few problems along the way with understanding some of the code, mostly due to it not being explained properly. We also have Game Coding complete 2nd edition, but most of it looks very confusing right now.
Can we get some advise or help?
Right now we are trying to figure out derived classes, heres where we are lost, earlier in the book it told us that in a class you need to use setter and getter methods, yet in the current program its telling us to make it doesnt use a setter for the cats name (i hope this makes sense...), we have a mammal base class with age and weight variables and they both use setters and getters, but with the cat class there is not setter for the name variable, we have tried playing around with the code and it doesnt accept a setter for name in cat.
Can someone please explain why it does not work?
If need be i can copy and paste the code that the book is telling us to write, and point out where we are puzzled.
EDIT: If someone knows a better book to learn C++ from then please say so.
Can we get some advise or help?
Right now we are trying to figure out derived classes, heres where we are lost, earlier in the book it told us that in a class you need to use setter and getter methods, yet in the current program its telling us to make it doesnt use a setter for the cats name (i hope this makes sense...), we have a mammal base class with age and weight variables and they both use setters and getters, but with the cat class there is not setter for the name variable, we have tried playing around with the code and it doesnt accept a setter for name in cat.
Can someone please explain why it does not work?
If need be i can copy and paste the code that the book is telling us to write, and point out where we are puzzled.
EDIT: If someone knows a better book to learn C++ from then please say so.
The post was edited 2 times, last by Drucygoddess ().