Programming in C
Prof. M. Victor Wickerhauser
Welcome to C programming! C is a formal computer language
invented in the 1970s to implement the Unix operating system. Its
inventors had two conflicting goals:
Unix became widespread in the 1980s. Each Unix system contains a C
compiler so that the user can write system utilities and extend the
computer's capabilities, so the C programming language became
widespread as well.
- maximum control over the computer's hardware, so that the
operating system could manage specific types of memory, arithmetic
processors, printers, keyboards, and other devices;
- maximum portability among different computers, so that the
operating system could be migrated to new machines with minimal
C was standardized in 1990 by an international committee of
engineers, into what is called ANSI/ISO 9899-1990 Standard C, or
ANSI C for short. This was necessary because dialects of the
now-popular language had appeared, but programs written in one dialect
would not always compile or run on a machine expecting another. Math
1201 will teach you to write correct ANSI C programs.
Topics. This course is an introduction to the international
standard version of the C programming language for networked and
personal computers. It emphasizes reading and understanding, but also
requires writing many correct programs. No previous knowledge of
computing is assumed.
Prerequisites. High school algebra and trigonometry, or
consent of the instructor.
Text. The lectures will follow Mark Allen Weiss,
Efficient C Programming: a Practical Approach, Prentice Hall, 1995.
Recommended reference texts are
A useful source for additional explanations is Cleon Yohe, Standard C
for Science and Engineering, available at cost from the Math
Department, Cupples I, room 100.
- Herbert Schildt, The Annotated ANSI C Standard, Osborne, 1990
- P. J. Plauger, The Standard C Library, Prentice Hall, 1992
Solutions are due at the end of class on the due date. Late
homework will not be accepted. The homework will often require
writing a working computer program, which will be judged for
correctness and clarity. Homework should be submitted on paper,
including the printed results of any programs. However, you will
occasionally be requested to provide the machine-readable program
source via email to firstname.lastname@example.org, so find
out now how to use your campus email account.
- HW #1, due Wed., Sep. 1 (Ans)
- HW #2, due Wed., Sep. 8 (Ans)
- HW #3, due Wed., Sep. 15 (Ans)
- HW #4, due Wed., Sep. 22 (Ans)
- HW #5, due Wed., Sep. 29 (Ans)
- HW #6, due Wed., Oct. 6 (Ans)
- HW #7, due Wed., Oct. 13 (Ans)
- HW #8, due Wed., Oct. 20 (Ans)
- HW #9, due Wed., Oct. 27 (Ans)
- HW #10, due Wed., Nov. 3 (Ans)
- HW #11, due Wed., Nov. 10
- HW #12, due Wed., Nov. 17 (Ans)
Tests. Midterm examinations: Test #1 (with
model solutions) Friday, September 24, 1999, in
class, and Test #2 (with model
solutions) Friday, November 19, 1999, in class. Cumulative final examination (with model
solutions) 6:00 pm - 8:00 pm Monday, December 13, 1999,
in the classroom.
Projects. By mid-term, you should choose one complex
programming project from a list, to be completed
alone or in teams of two. These projects will be due at the end of
the last class, Monday, December 6, 1999.
Grading. One letter grade will be assigned for homework, one
for the two in-class tests, one for the programming project, and one
for the final examination. These four will contribute equally to the
course grade. Students taking the Cr/NCr or P/F options will need a
grade of D or better to pass.
Computing. To create software with the C programming language, you need
The following combinations are recommended for this course:
- a text editor, which is a simple kind of word processor
used to write plain text files, readable both by humans and machines,
with names like "problem3.c" or "gcd_def.h", called source
- a C compiler, which is a computer program that translates the
source codes into more compact but human-unreadable machine
- a shell, which is a computer program that reads the
machine code, allocates any needed system resources, executes the
instructions, and communicates input and output between the
user and your program.
However, you are welcome to use any computing environment that hosts
an ANSI Standard C compiler and sufficient text editing and printing
capabilities to complete the homework. Recent versions of commercial
C++ compilers will also compile ANSI C source codes. For example, the
Borland C++ version 4 or Microsoft Visual C++ version 6 for IBM PC
type computers are both adequate for this course, as are their much
cheaper "instructional versions".
- Unix users in the Arts and Sciences Computing Center:
If you are familiar with campus email, then you can use its host
computer artsci.wustl.edu for your homework assignments:
- use pico, which is the default email text editor, as the
text editor for your source codes.
- use gcc, which is already installed, as the C compiler.
- use telnet from whatever terminal you usually use to
access your email, to start a shell on artsci in which you can edit,
compile, and run your programs.
- Users of IBM PCs or compatibles:
If you have a personal computer of this type with Microsoft Windows 95
or 98 or NT as its operating system, then:
- use Notepad, which is a Windows system accessory, as the
- obtain DJGPP, a free ANSI C compiler for Microsoft DOS and
Windows running on IBM-PC compatible computers, from its author's web
http://www.delorie.com/djgpp. An installation CD can also be
borrowed overnight from the instructor
- use the DOS shell by selecting "MS-DOS Prompt" from
the "Start/Programs" menu.
- Macintosh users:
If your Mac runs Mac OS 7 or 8, you can use the integrated development
environment called "Macintosh Programmers Workshop" (MPW), which is
available free from
Apple Computer, Inc. Look in !ReadMe.txt at that site for
downloading instructions, or start at the MPW link
for an overview.
- Use MPW Shell, which launches an edit window, as
the text editor.
- Use SC as the compiler.
- Use the command window of MPW Shell as the shell.
Office Hours. See the instructor in Cupples I, room 105a, on
Mondays and Wednesdays from 11-12 am, i.e., after class, or make an
appointment by telephone or email.
Questions? Return to
M. Victor Wickerhauser's home page for contact information.
Last modified on
December 13, 1999.