Pointers in C are easy and fun to learn. Some C programming tasks are performed more easily with pointers, and other c programming pointers, such as dynamic memory allocation, cannot be performed without using pointers. So it becomes necessary to learn pointers to become a perfect C programmer. Let’s start learning them in simple and easy steps.
Did not find what they wanted? Try here
A pointer is a variable whose value is the address of another variable, i. Like any variable or constant, you must declare a pointer before using it to store any variable address. C data type and var-name is the name of the pointer variable. However, in this statement the asterisk is being used to designate a variable as a pointer.
The actual data type of the value of all pointers, whether integer, float, character, or otherwise, is the same, a long hexadecimal number that represents a memory address. The only difference between pointers of different data types is the data type of the variable or constant that the pointer points to. There are a few important operations, which we will do with the help of pointers very frequently. This is done at the time of variable declaration. A pointer that is assigned NULL is called a null pointer. The NULL pointer is a constant with a value of zero defined in several standard libraries. Pointers in Detail Pointers have many but easy concepts and they are very important to C programming.