I recently looked through some C code and found something equivalent to the following:
struct foo {
int some_innocent_variables;
double some_big_array[VERY_LARGE_NUMBER];
}
Being almost, but not quite, almost completely new to C, do I understand correctly that this structure is terribly inefficient in using space due to an array member? What happens when this structure is passed as an argument to a function? Is it completely copied to the stack, including the full array?
Would it be better in most cases to have it double *some_pointerinstead?
source
share