Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Is it mandatory to use pointers in C++ for games?- I do not want to offend, but it follows from the question that you do not understand the pointer mechanism, the structure of programs in memory, optimizations and, as a result, you are very poorly oriented in C++.
If you do not use dynamic memory, then it is quite possible. And this is quite difficult, you will have to set hard limits for most elements. Of course, now there are STL, vectors and lists out of the box, but you also need to follow them. And so you can not do without pointers. + Some libraries can simply force you to use pointers.
Pointers and dynamic data structures are easy to follow. You need to understand when you allocate memory to them and you need to understand when the occupied memory needs to be cleared. In other modern languages, the garbage collector does this for you; C and C++ don't.
However, if you are so afraid of pointers, then you better switch to another language, since all the charm in C ++ is in memory management, and without it you are better off using another language.
PS Read about smart pointers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question