What is a pointer in C?
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:
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 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
Related Articles:
This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of C Programming Language, click the links and dive deeper into this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.