1.

What is the use of pointers?

Answer»

POINTERS are USED to store and maintain the addresses of memory blocks that are dynamically allocated. Data objects or arrays of objects are stored in these blocks. The heap or free store is a memory space in most structured and object-oriented languages from which objects are dynamically allocated.

Example in C:

#include <stdio.h&GT;void printpointer(){ int var = 10; int *pt; pt = &AMP;var; printf("The address is: %p \n",pt); printf("The value is: %d \n", *pt); }int main(){ printpointer();}


Discussion

No Comment Found