Also, we coded the two programs e1.c and
week.c during the session.
Useful little things for the assignment
Enumerations are useful if you've variables which take on
values from a small set. We looked at two examples for enumerations
We looked at the two example programs
Many people were trying to use linked lists in order to implement their
queues. In our situation it might be easier to use simply an array and two
variables for the begin and the end of the queue.
- the Queue code q.c implements this basic idea.
- Here's a fancy implementation of the array idea. This implementation
allows you to have as many queues as you want, etc...
- this afternoon, Hany and I coded a queue implementation based on a linked list:
You might want to use the debugger gdb in case you're stuck with segmentation
faults, bus errors, etc. If you never had any of these problems, you can try the program
bug.c. In order to use the debugger,
you should compile your code with option -g.
gcc -g bug.c
and run the executable a.out to get the segmentation fault. Next, start the debugger with
The most useful commands in the debugger are
I recommend that you get familiar with this powerful tool! (Also, check out the man page for
gdb and dbx).
It's possible to allow an unix machine to open a window on a Windows95/98 or NT computer.
However, you would need to install some software to do so - but you'll have lots of benefits.
Also, I'll check with people who are using PCs more frequently than me...
Here's a downsized version of my .emacs file. If you
want your emacs to come up with similar key-bindings and syntax highlighting
you should put this file in your home directory as .emacs