I have two large arrays of structures I could not declare as arrays (array too big error) but could allocate dynamically
n[138] and p[317]
and am trying to pass them as parameters to a function.
void create_reports (n_t n[], p_t p[]);
int main(void)
{
n_t *n;
p_t *p;
n = calloc(138,sizeof(n_t));
p = calloc(317,sizeof(p_t));
...
create_reports(n,p);
return(0);
}
The program works fine with smaller arrays but seems to pass the function garbled values with the full sized arrays. Am I running out of memory? Is it being passed by value and not address?



LinkBack URL
About LinkBacks


