I have been asked in an interview how do you pass an array to a function without using any pointers but it seems to be impossible or there is way to do this?
There is one more way: by passing size of array along with name of array.
int third(int[], int );
main() {
int size, i;
scanf("%d", &size);
int a[size];
printf("\nArray elemts");
for(i = 0; i < size; i++)
scanf("%d",&a[i]);
third(a,size);
}
int third(int array[], int size) {
/* Array elements can be accessed inside without using pointers */
}