+ 3
Class
Why is it so hard to understand class, especially when it comes to coding game with it...
2 Respostas
+ 3
if you know about structure and union in c, then you can easily understand the concept of class.
class is a blueprint from which objects are created.
you have to practice more and more , this is the only way, so best of luck .
+ 2
Why does it make a difference if it's for a game or not?
Classes are a tool you can use whenever you feel it helps your mission, just like variables or loops or whatever. You only need to first understand that tool.
Like functions. They are pieces of code that do a defined task, and you can call them as often as you want, from any place in your code.
And when would you need such a thing? When you have to do a task several times and don't want to write the same code several times.
So what are classes even good for? What is their job? How do they help making your code shorter, clearer, better to read?