Pointers are variables that hold the memory address of other variables. This can be explained by the following
int a = 5;
Let us assume that 1001 is the address of the variable a and this numeric address is stored in another variable named as b having address 1020.
We can access the values of variable a by using the pointer variable b.
Advantages of Pointers in C Programming
1) Pointers increase the execution speed of the program.
2) pointers enable us to access a variable that is defined outside the function.
3) pointers are used to pass information back and forth between a function and its reference point.
4) Pointers reduce the length and complexity of a program.
0 comments:
Post a Comment