I need a function that creates an array with some floating points.
double * my_function( )
{
static double arr[10] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
return arr;
}
int main ()
{
double *first_pos;
int i;
first_pos = my_function();
for ( i = 0; i < 10; i++ )
{
printf( "%d", *(first_pos + i));
}
return 0;
}
This prints some "random" numbers.
I'm a confused about pointers/arrays!