In previous posts we concluded the arrays topic. In next 2-3 posts we will discuss about pointers with some code examples. Pointers are used to store memory address of variables or arrays. In following simple program we created a pointer named as countPtr and a variable named as count. Then we assigned the address of the variable count
to the pointer countPtr. Now by using that pointer we can get the memory address of the variable count as well as the value of the variable count.
int count = 5;
countPtr = &count;
printf("Address stored in countPtr pointer is:n");
printf("To get the value of the variable to which the countPtr pointer is pointing, we use dereferencing:n");
printf("Value to which countPtr is pointing:n");