I think I figured some of it out...
Code:
void enter_a_point (struct point * );
is a pointer so I want to give it an address to point to? If that's correct then I give it &pt1 and &pt2
Code:
enter_a_point(&pt1);
enter_a_point(&pt2);
For this distance formula i need a value for pt1 and pt2, so I just send in what I have stored at those variables...
Code:
printf("Distance between the point = %.2f\n", distance(pt1,pt2));
distance formula is easy I want it to return the answer of my structure values running through it.
Code:
return sqrt(pow(pt2.x - pt1.x,2) + pow(pt2.y - pt1.y,2));
The enter_a_point function has me stumped still. I'm lost at what I put in there... it's looking for a point "p", and it's scanf so it should require &p and then .x and .y with respect to the question.
Code:
printf("\nEnter an X coordinate: ");
scanf("%f",&p.x);
printf("\nEnter a Y coordinate: ");
scanf("%f",&p.y);
which is giving me the error...
Code:
extra4.c: In function 'enter_a_point':
extra4.c:32: error: request for member 'x' in something not a structure or union
extra4.c:35: error: request for member 'y' in something not a structure or union