/* Operations on points */ Point mkpt(double x, double y); double dist(Point a, Point b); Point add(Point a, Point b); Point sub(Point a, Point b); void move(Point *p, double a, double b); void print(Point p);
This and the two following files
form the same program as the
simple C point demo earlier.
To compile, use these steps.
Say gcc -c cpoint.c. This compiles the point ADT and
produces the file cpoint.o. The cpoint.h file is read by the
#include directive during the compile.
Say gcc -c cpointu.c. This compiles the point ADT and
produces the file cpointu.o. The cpoint.h file is again read by the
during this compile.
Say gcc -o cpoint cpoint.o cpointu.o to combine the two object files
into an executable cpoint.
Of course, you could just say gcc -o cpoint cpoint.c cpointu.cb and
have it do all the steps for you, but that wouldn't be nearly so much fun.