This note covers various types of pointers to be aware of and a few notations used with pointers.
Types of Pointers
Pointer: Pointer is a variable which holds the address of another variable
NULL Pointer: A null pointer has a value reserved for indicating that the pointer does not refer to a valid object. It is pointer initialized to NULL value
Void Pointer: are pointers pointing to data of no specific data type. The compiler will have no idea on what type of object the pointer is pointing to. It has to be type casted to the required type
Dangling or Wild Pointer: are pointers that do not point to a valid object of the appropriate type. A normal pointer becomes dangling pointer when it is free’d.
Constant Pointer and Pointer to Constant:
Consider an example:
char data = ‘D’;
char * p = &data;
View original post 195 more words