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?
#include
typedef struct
{
int Array[10];
} ArrayStruct;
void printArray(ArrayStruct a)
{
int i;
for (i = 0; i < 10; i++)
printf("%d\n", a.Array[i]);
}
int main(void)
{
ArrayStruct a;
int i;
for (i = 0; i < 10; i++)
a.Array[i] = i * i;
printArray(a);
return 0;
}