dynamic memory newb question

Hello everyone :)

I want to understand what dynamic memory really is doing and when it should be used.

I have read about it on the homepage documentation, but im not sure if i understood it...

So far i have understood that dynamic memory is about loading and deleting variables at certain points in runtime instead of load all the variables before runtime.

For example if i should make a game that u could choose between 100 characters... but you only have to choose one. So loading all the characters before even starting the game would be a waste of time. So then u should use dynamic memory and only load whatever you need to load according to the players wish.

So... is that what dynamic memory is all about and when it becomes very nice to have and use?
Last edited on
closed account (zb0S216C)
+1 That's exactly what dynamic memory is for. It saddens me to see new-comers allocating memory for an "int". The general rule of thumb is that you should allocate large structures and/or arrays, because allocating dynamic memory for small, built-in types is unnecessary.

Wazzak
Topic archived. No new replies allowed.