General Discussions

Pointer and Types – C

PH Bytes

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

Let me Know What you Think!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s