Code:
int read_location(double *x, double *y)
{
printf("Enter x:\n");
scanf("%lf", &number1.x);
printf("Enter y:\n");
scanf("%lf", &number1.y);
}
This function should work one of two ways:
1 - Pass it a pointer to a structure, and fill it in.
2 - Pass it pointers to individual doubles, and fill those in.
You are doing half of each.
Code:
void foo( stuct bar *baz )
{
read into baz->x;
read into baz->y;
}
Or...
Code:
void foo( double *bar, double *baz )
{
read into bar
read into baz
}
If doing the latter, you need to assign those values to your structure (or pass the structure's elements individually). That might be done like so:
Code:
foo( &astruct.x, &astruct.y );
Or perhaps...
Code:
foo( &x, &y );
astruct.x = x;
astruct.y = y;
Pick one.
Quzah.