What is a pointer in C?

C Programming Language >   Pointer in C Language >   Pointer in C  

Long Question

771


Answer:

A pointer is a variable that refers to the address of a value. It makes the code optimized and makes the performance fast. Whenever a variable is declared inside a program, then the system allocates some memory to a variable. The memory contains some address number. The variables that hold this address number is known as the pointer variable.

For example:

 Data_type *p;  

The above syntax tells that p is a pointer variable that holds the address number of a given data type value.

Example of pointer


#include <stdio.h>  
int main()  
{  
   int *p; //pointer of type integer.  
   int a=5;  
   p=&a;  
   printf("Address value of 'a' variable is %u",p);  
    return 0;  
}  

Output

Address value of 'a' variable is 428781252


This Particular section is dedicated to Question & Answer only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.