In order to avoid declaring static variables in a function I was asked
to write a scratch memory.
Reserve a block of memory outside the function and assigning pointers
to the memory locations as per convenience and access them.
I was told this would save some memory. I dont understand the logic
behind this, as i`ve declared variables as global (assuming i`ve
declared the block in main() ) this would always b a residual data for
access at any point of the prog. against static var. which wud b
available for access only whn it enters the function.
If anyone has ever written a scratch memory pls confirm if my
understanding is right and its use too.
----
also any link to understand on how memory is handled during a
c-program`s (on windows) execution would b of hlp.
bye,
hurry.
to write a scratch memory.
Reserve a block of memory outside the function and assigning pointers
to the memory locations as per convenience and access them.
I was told this would save some memory. I dont understand the logic
behind this, as i`ve declared variables as global (assuming i`ve
declared the block in main() ) this would always b a residual data for
access at any point of the prog. against static var. which wud b
available for access only whn it enters the function.
If anyone has ever written a scratch memory pls confirm if my
understanding is right and its use too.
----
also any link to understand on how memory is handled during a
c-program`s (on windows) execution would b of hlp.
bye,
hurry.
Comment