Miscalculation of array size inside a function

Because in main you have an array and in the function you have a pointer to that array.

int doStuff(int afm[])

is equivalent to

int doStuff(int *afm)

Leave a Comment