The closest idea I've come up with is that the OP might want to pass an array by value. And wrapping such a thing in a struct [C background] is one way to do this ugly thing. An example:
Code:
#include <stdio.h>
struct type
{
int array[10];
};
void print(struct type object)
{
size_t i;
for ( i = 0; i < sizeof object.array / sizeof *object.array; ++i )
{
printf("object.array[%d] = %d\n", (int)i, object.array[i]);
}
}
void foo(struct type object)
{
size_t i;
for ( i = 0; i < sizeof object.array / sizeof *object.array; ++i )
{
object.array[i] *= 10;
}
print(object);
}
int main()
{
struct type object = { {1,2,3,4,5,6,7,8,9,10} };
foo(object);
print(object);
return 0;
}
/* my output
object.array[0] = 10
object.array[1] = 20
object.array[2] = 30
object.array[3] = 40
object.array[4] = 50
object.array[5] = 60
object.array[6] = 70
object.array[7] = 80
object.array[8] = 90
object.array[9] = 100
object.array[0] = 1
object.array[1] = 2
object.array[2] = 3
object.array[3] = 4
object.array[4] = 5
object.array[5] = 6
object.array[6] = 7
object.array[7] = 8
object.array[8] = 9
object.array[9] = 10
*/