c programming language

India
February 2, 2007 5:58am CST
what are the difference between array and pointer. what are the advantages of pointers over the array. these all types of question are in my mind. some times its seems that these aspects are easy and some times its seems its too hard.
2 responses
@beep310 (25)
• Togo
3 May 08
I always think of a pointer as "pointing" to a memory allocation. So if you wanted to have the value to a cell, you could use a pointer. An array is sort of kind of like a list.
@smrohitsm (231)
• India
2 Feb 07
Arrays and pointers haave nothing in common. Both have their own advantages and disadvantages.And bothe r mutually exclusive. a pointer is a variable which stores the address of another variable.i.e it points to some other variable. suppose variable 'a' has address "0xAD" then a pointer 'b' to this variable will have value "0xAD" stored in it. 'a' might be an integer storing some no. but 'b' stores its physical address. So 'b' is a pointer to 'a'. An array is a collection of values. i.e u can store 10 integers in an integer array of size 10. just as singular variables, arrays also have datatypes like int,char etc. u can have a pointer to an array, it will store the address of the starting location of the array in the memory.