An Introduction to C
Introduction
The aim of this course is to provide students with a generous study of the C programming language, while nurturing and developing logical thought. To achieve this, I strive for a pedagogical balance of rigorous study and paced learning. At the conclusion of the course, students will possess a heightened understanding of computer programming as it applies to C, while grasping logical concepts relevant to other programming languages, as well.
Crucial concepts such as arrays, memory management, structs, preprocessor directives, compiler translation phases, side effects and sequence points, and pointers will be covered in exhaustive detail. The topics of primitives, selection structures, and looping constructs, to name a few, will receive less scrutiny. The former group of topics requires more discussion and analysis, while the latter group will be reinforced through textbook study.
Prerequisite
Other than handling basic computer tasks, such as navigating the Internet, using email, and installing/uninstalling software on a computer, no prior programming experience is required.
Topics Covered
- Basic types
- Decision making
- Equality, relational, and logical operators
- Storage classes
- Arithmetic operations
- Escape sequences
- Good programming practices and clear and proper documentation style/techniques
- Strings
- Control structures
- Functions
- Structures (structs)
- References, scope, and variable lifetime
- Error handling
- Testing and debugging
- The preprocessor
- Unions
- Typedefines
- Arrays
- Pointers
- Linked list data structure
- Queue data structure
Readings
The required textbook, from which the semester's readings (listed below) are assigned:
Edition: Fourth Edition
Author: Deitel & Deitel
ISBN: 0–13–142644–3
- Chapter 1: Introduction to Computers, the Internet and the World Wide Web
- pages 8 — 10 (§ 1.8, 1.9)
- pages 13 — 15 (§ 1.14)
- Chapter 2: Introduction to C Programming
- pages 26 — 44 (§ 2.1 — 2.6)
- Chapter 3: Structured Program Development in C
- pages 57 — 82 (§ 3.1 — 3.12)
- Chapter 4: Program Control
- pages 100 — 126 (§ 4.1 — 4.12)
- Chapter 5: C Functions
- pages 143 — 198 (§ 5.1 — 5.15)
- Chapter 6: Arrays
- pages 199 — 240 (§ 6.1 — 6.9)
- Chapter 7: Pointers
- pages 258 — 297 (§ 7.1 — 7.12)
- Chapter 10: C Structures, Unions, Bit Manipulations and Enumerations
- pages 393 — 418 (§ 10.1 — 10.11)
Assignments
There will be three homework assignments spread out by about four weeks each. You are welcome to discuss them with classmates, as a discourse is always helpful, but not to share source code.
Compiling Environment
To an experienced programmer, the Integrated
Development Environment, or IDE, can be helpful in
writing and building programs. However, in the hands
of an inexperienced programmer, an IDE
typically displays a high learning curve, proves to be
confusing, and distracts from learning how to program.
Thus, gcc, a C
compiler whose primary variant runs in a
command–line interface and is available for
Windows®, Mac, and Linux, will be the compiler
used for in–class examples and assignments.
No IDE
will be supported.
In terms of editors, you're welcome to use any program that renders basic text. I can provide support if you use Emacs, which is available for the three major operating systems.
Announcements
- 7 February 2011:
- Although this Friday is a holiday, we will still be meeting at our regular time.
- 4 February 2011:
- Welcome to the class. Any important announcements will be made here and also on the private Google group for this course.
Schedule
- Day: Friday
- Dates: 4 February 2011 — 22 April 2011
- Time: 6:00 PM — 8:00 PM (with a 15–min break at about 7:00 PM)
- Place: 1025, Hunter East, Hunter College (map)
Homework
- Homework 1: due Thursday, 10 March 2011, by 11:59 PM
- Homework 2: due Thursday, 7 April 2011, by 11:59 PM
- Homework 3: due Thursday, 28 April 2011, by 11:59 PM
All work is due by 11:59 PM on their respective days. Click the following link for directions on how to submit your homework: HW submission instructions.
Resources
Software
- Splint, a tool for statically checking C programs for security vulnerabilities and coding mistakes. It can perform stronger checking than can be done by any standard lint.
Tutorials
- C FAQs
-
How to modify
your Windows path to work with the GNU C Compiler
(
gcc). - How to compile your C programs from the command prompt
Papers
- Henry Spencer's The Ten Commandments for C Programmers
Books
For those of you looking for a deeper understanding of C, the following is a list of excellent C reference texts.
Videos
The 1986 SICP video lectures by MIT's Hal Abelson and Gerald Jay Sussman are fantastic resources in helping to understand logic in programming languages. Although Professors Abelson and Sussman teach LISP in these lectures, the themes are universal. The lectures' accompanying book, The Structure and Interpretation of Computer Programs, AKA The Wizard Book, is available in HTML format for free.
SICP
videos: http://groups.csail.mit.edu/mac/classes/6.001/abelson–sussman–lectures/
SICP online book: http://mitpress.mit.edu/sicp/full–text/book/book.html
Contact
r v a n e g a s a t h u n t e r d o t c u n y e d u
Last modified:
![[Cover of C How To Program by Deitel & Deitel]](../images/c-how-to-program.jpg)