Class CS 262 001/002 Introduction to Low-level Programming, Spring 2012 (1:1:0)
Syllabus syllabus
Instructor Zoran Duric
Tuesday/Thursday 3:00 - 4:00 pm, Wednesday 10:20 - 11:20 am, or by appt.
Teaching Assistants Mohamed Elsabagh, GTA
Email: melsabag_at_gmu_dot_edu
Office hours: Monday 10:00 am-1:00 pm

Sasanka Jandhyala, GTA
Email: sjandhya_at_masonlive_gmu_dot_edu
Office hours: Wednesday 10:00 am - 1:00 pm

Dale Gartman, UTA
Email: dgartman_at_masonlive_gmu_dot_edu
Office hours: Monday/Friday 1:00 pm - 3:00 pm at Johnson Center 218
Schedule slides, code, and sessions scripts


  • Brian Kernighan and Dennis Ritchie, The C Programming Language, 2nd ed., Prentice Hall, 1988
  • CiteSeer seems to kees a copy of the book here

Recommanded books/readings


C compilers

You should program with the gcc compiler. gcc is available on (virtually) all Unix systems. This includes the mason cluster, Linux, Cygwin (on Windows), and Mac OS X.

If you are working on a Windows machine you should get a DOS port of gcc. This, of course, involves using DOS. To do this select Run... from the taskbar and then type cmd. A DOS window will open for you. Working from a command line on DOS is much like using a Unix shell. Google "DOS commands" for information on using DOS. You will need an editor (or an IDE -- see below). Do not use Notepad or a word processor.

Two good Windows ports of gcc are djgpp and MinGW.

James Fowler's setup program for djgpp (with gdb and make) is here. A version of this setup which also includes flex and bison is here. James Fowler has also written a tutorial on installing and using djgpp. It can be found here. Note: the djgpp port of gcc not run on 64-bit versions of Windows. 64-bit Windows users should use MinGW.

MinGW can be downloaded here. Follow the link "HOWTO Install the MinGW (GCC) Compiler" to get going.

For Mac OS X users: gcc does not come installed on your Mac. You must install Xcode (an IDE for Mac) -- this will install gcc.


Emacs is a very powerful and popular editor. It is available on all Unix/Linux systems. Learning Emacs is not particularly easy, but it is worth the effort. When you start Emacs typing ctrl-h t will start a lesson on how to use it. If you get frustrated you can get a session with a psychotherapist by typing alt-x doctor (or esc x doctor). Several tutorials on using Emacs are available on the web (Google "Emacs tutorial"). A Windows port of Emacs can be downloaded from

jEdit is an editor whose operation is similar to a word processor. It is available from It runs on all relevant systems. jEdit is easy to learn and complete documentation is available from the jEdit website.

Integrated Development Environments

An integrated development environment (IDE) is a program which provides (or provides access to) a compiler, editor, debugger, and from which you can also run your program. Using an IDE gives you the convenience of being able to do all your programming work from one program rather than having to run several different programs from the command line.

NetBeans can be used to write C programs. From the Tools menu select Templates and then select C source file unter the C tab.

Another option for Windows users is Dev-C++. This is an IDE which comes along with (another) port of gcc. It can be downloaded from

Note to Dev-C++ users: When you run your program from the IDE a window is opened in which the program runs and then the window closes immediately. This may make it appear that your program did not run completely (or maybe at all). To get around this put this (temporary) line at the end of main:

The window will now stay open until you hit any key.

Zoran Duric: zduric_at_gmu_edu 1/22/2012