I guess you sorted it out by now, let me just give you a quick summary on where a program can store its variables.
there are only 3 possible locations where variables can be stored:
1) in your executable (as data statements, they are loaded in memory with all instructions the exe has got, this happens when the process is created).
2) on the stack (this is a memory location which is reserved for your process as long as it runs, and is allocated when the process is loaded into memory).
3) somewhere in memory (that has been allocated dynamically by you).
Now I will try to show when a variable goes into what section.
1) EXE: all data you directly type into your code (numbers, strings...). AND variables you declare globally (outside of functions... somehow I guess also class declaration).
2) STACK: variables you declare in a local function, return variable of functions, and everything that has to do with function calls...(so called stack frame: holds all data that belongs to a CALLED function at runtime)
3) MEM: if you allocate somehing.. and you write into that part, then it is in MEM (everything is actually in mem, if its not swapped out to disk
)
Hope I did not make a big mistake.
Any questions left?
greets,
Barnski.
-- I just started with DarkSDK, by translating DBP Projects. --