10 Oct 2008

Simplifying the concept of 'pointers'

CEans,

I keep on getting lots of interesting queries in my mailbox. One of the college students asked me about pointers and I think we'd better discuss the topic on forums.

I've seen lots of computer engineering students [especially those who study C Programming], find it difficult to absorb the concept of 'pointers'. So, I request the programming enthusiasts to explain the concept of pointers in very simple language , with examples so that students across the world benefit.

Looking forward to your response.
niraj.kumar

niraj.kumar

Branch Unspecified
10 years ago
Re: Simplyfying the concept of 'pointers'

Pointer is the variable that store "address" on another variable . As address is always integer so the type of pointer is also integer
10 years ago
I'm expecting a brief article on the same. Although the concept has been explained in all the books on C, it would help if someone write an article in his/her own words.
Prasad Ajinkya

Prasad Ajinkya

Branch Unspecified
10 years ago
A pointer is a look-up. Let's say you are lost in a city like Mumbai, and you want to go to the Gateway of India, but you do not know where it is. What do you do? You go to the nearest Mumbaikar and ask him, "Sir, how do I reach the Gateway of India?" ... he will say, "Take the train to Churchgate, from there take a cab to the Gateway" ... effectively he gives you the address ... so he points you in the right direction.

Similarly, pointers are data objects where the address of the real data you are seeking is stored.

Share this content on your social channels -

Only logged in users can reply.