/* * Example of C structures */ struct point { double x; double y; }; #include #include double distance( struct point a1, struct point a2); double distance( struct point a1, struct point a2) { return sqrt( pow(a1.x - a2.x, 2.) + pow(a1.y - a2.y, 2.) ); } int main(void) { struct point a = {0., 0.}, b = {3., 4.}; printf("%f\n", distance(a, b)); return 0; }