"In C++, it's harder to shoot yourself in the foot, but when you do,
you blow off your whole leg." -- Bjarne Stroustrup
C++, and its older cousin, C, consistently remain in the top three
most popular programming languages used today (see the
TIOBE programming community index).
Virtually every piece of desktop software you use is backed by either C
or C++. In short, C++ is one of the most relevant programming languages
today even though it is over 30 years old, and there are no signs of
its slowing down.
The easiest way to get the example .c and .cpp files onto your
eniac account is to use wget. Simply type wget "URL" (with the
quotation marks around the URL) to download the file located at the URL
to your current directory. For example: wget
"http://www.cis.upenn.edu/~cis190/spring2014/lectures/01/hello_world.c"
will download hello_world.c to the directory from which the command is run.
This page will be filled out with links to slides, example code, and
other useful information as the semester progresses.
Syllabus
- Week 1, Jan 16: Introduction and Getting Started
- Week 2, Jan 23: Pointers and More
- lec02.pdf: Lecture Notes
- helloFunc.zip:
zip file containing Hello World implemented with functions in
separate files; contains instructions
- structs.c:
Example of structs, arrays of structures, and pointers
- Lecture notes on pointers from MIT -- good introduction to pointers, goes into a lot more depth
- Week 3, Jan 30: Memory Management in C
- lec03.pdf: Lecture Notes
- Makefile: Makefile with
every tip and trick (and the #1 rule!) discussed in class
- sample.c:
code used in demonstration of ddd debugger in class
- Week 4, Feb 6: Assorted Topics (and More on Pointers)
- Week 5, Feb 18 (Makeup): Linked Lists
- lec05.pdf: Lecture Notes
- linkedList.c:
function definitions for a basic linked list implementation
- linkedList.h:
function prototypes for a basic linked list implementation
- llExample.c:
example of a main() using the basic linked list implementation
- Week 6, Feb 20: Introduction to C++
- Week 7, Feb 27: C++ Streams
- Week 8, Mar 6: Classes in C++
- lec08.pdf: Lecture Notes
- date.cpp:
example of a basic class implementation, using the
Date() class discussed in the lecture notes
- Week 9, Mar 20: Vectors, Enumeration, and Overloading
- Week 10, Mar 27: Inheritance
- lec10.pdf: Lecture Notes
-
carInheritanceExample.zip:
example of inheritance, using Car and Vehicle classes; includes
overriding, overloading, and explicitly calling parent functions
- Week 11, Apr 3: Polymorphism
- Week 12, Apr 10: Student Choice Topics
- Week 13, Apr 17: Research Presentation
- Week 14, Apr 24: Student Project Presentations