Hi all:
Its 2:30 am and I can't figure this out. Maybe I'm just overlooking
the obvious here, so I hope u can help.
I pass a function an array by reference, and the function
assigns values to the array. For now the array is a static
predetermined size, and the assigned numbers aren't random yet.
(i will be implementing that next).
It appears only the first element in the array is assigned the value,
the rest are not set. What am I doing wrong?
and if I enable that printf line in the function, it gets to 22 then quits
[This message was edited by megadave on May 10, 2002 at 02:36.]
Its 2:30 am and I can't figure this out. Maybe I'm just overlooking
the obvious here, so I hope u can help.
I pass a function an array by reference, and the function
assigns values to the array. For now the array is a static
predetermined size, and the assigned numbers aren't random yet.
(i will be implementing that next).
It appears only the first element in the array is assigned the value,
the rest are not set. What am I doing wrong?
and if I enable that printf line in the function, it gets to 22 then quits
Code:
#define MAX_CALLS 40
//in main
float acw[MAX_CALLS]; // the array to hold ACW times
void assignValues(float *acw)
{
int i = 0;
float value = 1;
for(i = 0; i < MAX_CALLS; i++){
acw[i] = value;
//printf("Assigned acw[%d] = %f\n", i, acw[i]);
}
}
[This message was edited by megadave on May 10, 2002 at 02:36.]