I want to pass the circle[1] by reference to the getCircle function. My code works, but the part where i put &(*circ).centre.x etc seems a little weird. Is there a better way of doing it?Code:int main(void)
{
struct circle circle[MAXCIRCLES]
getCircle(&circle[1]);
}
void getCircle(struct circle *circ)
{
printf("Centre: ");
scanf("%f, %f", &(*circ).centre.x, &(*circ).centre.y);
printf("Radius: ");
scanf("%f", &(*circ).radius);
}