Programming in C


Wed Jan. 23, 9:00-11:00pm, 1-115; Fri, Sat Jan. 25, 26, 5:00-7:00pm, 14-0637
Wed Jan. 30, 9:00-11:00pm, 1-115; Fri, Sat Feb. 1, 2, 5:00-7:00pm, 14-0637

No enrollment limit, no advance sign up
Participants requested to attend all sessions (non-series)
Prereq: Some programming experience encouraged

The C programming language is still the most popular for large software projects in both the open-source and commercial worlds. This course will quickly cover the fundamentals of programming in C, including basic control structures, functions, pointers, and arrays, and an introduction to the standard C library.

Instructor: Geoffrey Thomas (geofft)

Day 1 Class Notes

Today we covered compiling programs on Athena, calling functions, arithmetic, integer and floating-point types, conditional logic, and loops. We also briefly looked at stdio (printf and scanf) and the stack model of program execution.

Notes on Installing a C Compiler

If you have a Windows computer, you can install Dev-C++, an IDE (integrated development environment) based around gcc, the compiler we use in class. To create a file, click File | New Source File and save it with a .c extension.

You can also install your OS's port of gcc directly:

Note that Windows computers typically use executables ending in .exe, so you would use e.g. gcc -o hello.exe hello.c. In addition, on most *nix systems other than Athena, you will need to run ./hello instead of hello — Athena puts the current directory (.) into your path. Feel free to send me an e-mail if you need a hand getting your compiler working.