How memory is reserved using a declaration statement in data structure?
Submitted by: AdministratorMemory is reserved using data type in the variable declaration. A programming language implementation has predefined sizes for its data types.
For example, in C# the declaration int i; will reserve 32 bits for variable i.
A pointer declaration reserves memory for the address or the pointer variable, but not for the data that it will point to. The memory for the data pointed by a pointer has to be allocated at runtime.
The memory reserved by the compiler for simple variables and for storing pointer address is allocated on the stack, while the memory allocated for pointer referenced data at runtime is allocated on the heap.
Submitted by: Administrator
For example, in C# the declaration int i; will reserve 32 bits for variable i.
A pointer declaration reserves memory for the address or the pointer variable, but not for the data that it will point to. The memory for the data pointed by a pointer has to be allocated at runtime.
The memory reserved by the compiler for simple variables and for storing pointer address is allocated on the stack, while the memory allocated for pointer referenced data at runtime is allocated on the heap.
Submitted by: Administrator
Read Online Data Structures Job Interview Questions And Answers
Top Data Structures Questions
☺ | What is data structure? |
☺ | List out the areas in which data structures are applied extensively? |
☺ | If you are using C language to implement the heterogeneous linked list, what pointer type will you use? |
☺ | What is the data structures used to perform recursion? |
☺ | What are the methods available in storing sequential files ? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |