By using a declaration statement how is memory reserved

By using a declaration statement how is memory reserved?

E

Expert

Verified

Memory is reserved by using data type within the variable declaration. For its data types, programming language implementations consist of predefined sizes.

For illustration, into C# the declaration int i; it will reserve thirty two bits for variable i.

For the address or the pointer variable, a pointer has declaration reserves memory, but not for the data which this will point to. The memory for the data pointed through a   pointer has to be assigned at runtime.

The memory reserved through the compiler for easiest variables and for storing pointer address is assigned upon the stack, whereas the memory assigned for pointer referenced data at runtime is assigned upon the heap.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.