Quote:
|
Originally Posted by commonbullet
consider the 3 situations:
Quote:
1: new test[32]
2: format (test,8,"testing")
3: format (test,1,"t")
|
Is there any difference in memory space used by "test" variable? or maybe the space is reserved in 1) (?) and it doesn't change.
|
There is no memory space difference between these two. new test[32] in a function reserves space for 32 elements on the stack (the stack is pre-allocated as well; the compiler estimates the stack usage; it should alloc more than needed, especially if recursion is involved)
new test[32] on the global scope would add 32 cells to the data section.
__________________