thelearner
Programmer
Hi,
Here is my program snippet. It suppose to set the entire array to 37.0. But why does it show 0 when I output the 1st 2 elements. Is something wrong on my printf statements?
Thanks in advance.
float values[100];
float *pt3;
int ii;
pt3 = values;
for (ii = 0; ii < 10; ii++)
{
*pt3++ = 37.0;
printf("value[0] = %d\n", values[0]);
printf("value[1] = %d\n", values[1]);
}
Here is my program snippet. It suppose to set the entire array to 37.0. But why does it show 0 when I output the 1st 2 elements. Is something wrong on my printf statements?
Thanks in advance.
float values[100];
float *pt3;
int ii;
pt3 = values;
for (ii = 0; ii < 10; ii++)
{
*pt3++ = 37.0;
printf("value[0] = %d\n", values[0]);
printf("value[1] = %d\n", values[1]);
}