When you started today's lesson you clicked a button to copy a file into your
own examples directory (i.e., the directory named examples inside
your home directory). Assuming that the files were successfully copied, you
now have a file named ``rods.c'' in that directory.
Use Emacs to view ``rods.c''. The program can also be
viewed directly.
You'll notice three important things about the program:
- The comment at the top of ``rods.c''
says that this programs solve the three-rod problem that we previously
discussed. That is, each program determines the X-Y center position of a
circular rod that is being supported by two other circular rods.
- The program is structured a little differently than the other C
programs that you've seen previously. For example, until now all of our
C programs have started with a main function. But the main
function in ``rods.c'' doesn't appear until over halfway through the
file! This is because the main function in ``rods.c'' is preceded by
definitions of five new functions.
- The program is not complete! Three of the functions are
incomplete. You'll be writing the missing pieces of the program in today's
homework.
Eric N. Eide
Hamlet Project
Department of Computer Science
University of Utah