In some cases, a student may fail ECE 150 Introduction to
Computing and yet be promoted before being able to clear
that failure. As a result, some students are very frustrated coming into ECE 250,
and some, unfortunately, will resort to plagiarism. The following is a
sequence of lessons which start at more-or-less the very beginning
of ECE 150 and take it from there. Even if you passed, or did well
in ECE 150, I think there are enough interesting tid-bits and facts
which would make reading these worth your while.
If you do not have access to a C++ compiler, please download
and install Dev C++.
The first tutorial is located here.
An expanded version of the first tutorial is here
together with the source in a zip file.
Topic 0: Introduction
- What all this, then?
Topic 1: The Basics
- Hello World!
- Commenting Your Code
- Built-In Data Types
- Variables
- Location of Variables
- Selection Statements
- What's Really True? (Type Promotoion and Casting)
- While Loops
- A Short-Cut To Mushrooms
- For Loops
- A First Lesson in Pointers
- Pointers with Arrows
- Pointers into the New World
- Problems with Pointers
- Arrays
- Constant Variables const
- Arrays are ... Pointers?
- The Static Nature of Arrays
- Dynamic Arrays
- Resizing Arrays
- Functions
- Pass by Value
- Passing Arrays
- Pass by Reference (typename &)
- Refactoring Functions
- Returning by Value and by Reference
- #ifndef Preprocessor Directive
- #include Preprocessor Directive
- Namespaces and using
- Class Declaration
- Global Function Declaration
- Templates
- Class Member Declaration
- Visibility (public, protected, private)
- Member Variables
- Static Variables
- Class Constant
- Constructors
- Destructor
- Copy Constructors
- Assignment (operator =)
- Accessors
- Mutators
- Friends
- Initializing Static Variables
- Class Member Function Definitions
- Accessing Protected Base Member Variables in Derived Classes with Templates
- . versus ->
- Linked List Example
Topic 3: Miscellaneous Features
- The Preprocessor
- Do-While Loops
- The Ternary ?: Operator
- Nice Return Statements
- Can this == 0?
- What is the difference between 0 and NULL
- ++i versus i++
- #include <iostream> versus #include <iostream.h>
- Breaking out of Loops (and using goto)
- The switch statement
- Deleting this
- Pointer Arithmetic
Topic 4: Debuggers
- Introduction to Debuggers
Topic 5: C for C++ Programmers
If you intend to do serious programming in C, I
recommend Steve Oualline's Practical C Programming,
published by O'Reilly & Associates, Inc.
- Printing (C's cout)
- Comments
- For Loops
- Casting
- Strings
- Dynamic Memory Allocation
- Structures (Class without the Bells and Whistles)
- Scanning (C's cin)
- More Strings
- Trees in C
Appendicies
- Binary and Hexadecimal Numbers
- ASCII Characters
Ideas
I need a chapter on expressions and precedence. Instead of overwhelming students
with one big table of precedence, we should start with + - * / and =, followed
by increasing this precednece table with each new operator.
Acknowledgements
A number of students have looked at these pages and provided feedback. Those
who have provided feedback are listed here and their assistance is greatfully
acknowledged.