Just something I wasn't aware of...
Code:
#include <stdio.h>
int test_array1[] = { 1,2,3,4,5,6, };
int func_test_array3(int test_array3[6])
{
return(sizeof(test_array3));
}
int func_test_array5(int len)
{
int test_array5[len];
return(sizeof(test_array5));
}
int main(void)
{
int test_array2[6];
int test_array4[] = {1,2,3,4,5,6,};
printf("sizeof(test_array1): %d\n", sizeof(test_array1));
printf("sizeof(test_array2): %d\n", sizeof(test_array2));
printf("sizeof(test_array3): %d\n", func_test_array3(test_array2));
printf("sizeof(test_array4): %d\n", sizeof(test_array4));
printf("sizeof(test_array5): %d\n", func_test_array5(6));
return(0);
}
Code above outputs:
sizeof(test_array1): 24
sizeof(test_array2): 24
sizeof(test_array3): 4
sizeof(test_array4): 24
sizeof(test_array5): 24