Short Note on Pointer in C language

No comments



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.

Null Pointer : A null pointer is a special pointer that points now here. That is no other valid pointer to any other variable or array cell or anything else well ever be equal to a null pointer. Null is a constant that is defined  in the standard library and is the equivalent of zero for a pointer. Null is a value that is guaranteed not to point to any location in memory.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀