Why a pointer is needed in c programming?
The C language has no implicit memory allocation and garbage collection, so when you allocate memory from the heap, you have use a malloc (or related) operation, and when you are done with the object, you have to free it up explicitly. To pass these objects around, you pass a pointer (or “reference” in other language terminologies) instead of the object itself. This makes passing large objects much faster, but there are inherent disadvantages to this as well. Also, the designers of C intertwined the notions of arrays and pointers to the point that an array reference is a convenient method of doing pointer arithmetic, and as such, array references can be rewritten as pointer arithmetic references. This made the language easier to design and implement, but I think it also added to the complexity of learning the language and maintaining source code written in it.