update:
Got rid of those errors, now code looks like:
Code:
printf ("The triangle:\n");
printf ("\tVertex[0] is [%.02f, %.02f]\n", random.vertex[0].x, random.vertex[0].y);
printf ("\tVertex[1] is [%.02f, %.02f]\n", random.vertex[1].x, random.vertex[1].y);
printf ("\tVertex[2] is [%.02f, %.02f]\n", random.vertex[2].x, random.vertex[2].y);
struct point centroid;
printf ("\nThe centroid is: [%.02f, %.02f]\n", calcCentroid(centroid.x), i);
}
struct triangle calcCentroid (struct triangle *random)
{
struct point centroid;
centroid.x = (random->vertex[0].x + random->vertex[1].x + random->vertex[2].x) / 3;
centroid.y = (random->vertex[0].y + random->vertex[1].y + random->vertex[2].y) / 3;
return;
}
and now getting:
hw12.c: In function 'main':
hw12.c:44: error: incompatible type for argument 1 of 'calcCentroid'
as error.