Reserving of memory in data structure while declaration

Describe the reserving of memory using a declaration statement in data structure?

E

Expert

Verified

Memory is reserved by using data type in the variable declaration. There for its data types a programming language implementation is predefined sizes.

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

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

The memory reserved through the compiler for simple variables and for storing pointer address is allocated upon the stack, when the memory allocated for pointer referenced data on runtime is allocated at the heap.

   Related Questions in Database Management System

©TutorsGlobe All rights reserved 2022-2023.