Here explains a little about pointers. Yes the pointers are easy, of course. But take care in your building path. If you go through pointers deeply, you will see the complexity.
In C address is only for l-values. It can be a variable or something. If we assign p = &a, the type of p is int * – pointer to an integer. type of ‘a’ is int and type of ‘&a’ is int *. C language is a weakly typed language. ie when we use assignment, C allows to assign the right most thing to the left most without checking the types of these two.
p = 1;
*p = 10;
Consider the above statements in C. We declared p as a pointer variable. Then 1 is assigned to p. In the third statement 10 is assigning to the memory location 1. What about the memory location 1, is there exists a memory address 1. Usually not. If yes, of course it isn’t accessible. OS allows the program to access only within a particular memory location. This is Memory protection. If OS takes no care about memory protection what happens? In that system so many programs are running and two programs want to store data on say 2000 th location then what happens? The programs access wrong data.
p = 0;
*p = 10;
By executing above statements there is no error at compile time. Why? C takes zero as a pointer.
Its easy to go further.