Reputation: 458
The following piece of C code compiles under gcc 4.7, on a Debian (run with gcc -c filename.c
)
typedef int array_type[3];
int a[] = {1,2,3};
int* asd1(void){
return a;
}
array_type* asd2(void){
return &a;
}
Instead of using the typedef
I want to use the actual type. However, if I replace array_type*
with something like int*[3]
it doesn't compile.
What should I replace array_type*
with to make it semantically the same as above and compile correctly?
Upvotes: 1
Views: 108