Short Note on Pointer in C language
Pointer : A pointer is a special type of variable that stores a memory address rather than a primitive value like int, char, float, etc. Usually , the address stored in the pointer is the address of some other variable. It is a variable that can hold the address if another variable.
Example :
int * ptr; /*declare a pointer variable which can store address of integer variables*/
ptr = &count; /*store the address of count in ptr. The unary operator ‘&’ returns the address of a variable */
Difference types of Pointer :
Void Pointer : Void pointer can point to a variable of any data type, from an integer value or a float to a string of characters. The type casting or assignment must be used to turn the void pointer to a pointer of a concrete data type to which we can refer.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment