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 FunctionsProgram Control
- 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 and a midterm. You are encouraged to discuss the homework assignments with others, 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
- 22 January 2010:
- None.
Schedule
- Day: Sundays
- Dates: 7 February 2010 — 2 May 2010
- Time: 10:00 AM — 12:00 PM (with a 15–min break at about 11:00 AM)
- Place: 1025, Hunter East, Hunter College (map)
Homework
These are tentative dates.
- Homework 1: due Saturday, 6 March 2010, by 11:59 PM
- Homework 2: due Saturday, 27 March 2010, by 11:59 PM
- Homework 3: due Saturday, 17 April 2010, 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
The following is a list of texts for those of you looking for a deeper understanding of C.
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
Roy Vanegas
Last modified: Sat Mar 06 21:19:15 EST 2010
![[Cover of C How To Program by Deitel & Deitel]](images/c-how-to-program.jpg)