Quote: "Can you use the sizeof() function for RAM usage?"
It returns: 52092828, oh dear lol.
If thats in bits then i guess its 13023207 bytes, 13023 KB, 13Mb, 0.013GB?
Heh, does anyone know a good alternative to storing large arrays like paths?
[edit]
Wow, ok, i realised i put in the wrong code (posted before i read Bran flakes91093s post so i didnt see his example) before i had it on:
int pointer = sizeof(GridSquares);
Changed it to:
int pointer2 = sizeof(GridSquare) * AmountX * AmountY;
(AmountX and Y are the amount of tiles on that coord)
And the size in bytes? is 50070000... ouch, 47.75 MB if i calculated it right.
When i am pathfinding i got to store all possible paths because it swaps between them when its finding the best route, i heard that binary heaps are another good way of storing this, but whats better binary heaps or vectors?
Or even something else?
PS. Types is indeed an enum and the code for it is:
typedef enum SqTypes{Empty,Wall,Player,Enemy,Check,Sea}Types;