pointers jinsoft

C series for 1st sem students: Pointers as array arguments

Posted on Posted in Blogs, Technology

Pointers are used extensively in array operations. The name of the array is actually a reference to the address of the first element, rather than the actual array. Thus the array name is a pointer. So when we pass an array as an argument to a function, we are not actually passing a copy of the array (as we do in case of a variable), but we are passing a copy of the pointer to the first element of that array. This is the “pass by reference” hack that we discussed earlier.