Week
| Date
| Lecture
| Recitation
| Reading
| Homework
|
1
| Mon Aug 22, 2011
|
|
- Help with HW0
- Logging in
- Editing files
- Using g++
Attend as needed this week only
|
All reading is from Weiss Ch. 0: Introduction Ch. 1: Basic Types & Control Structures
Do the reading before class for the week.
| HW0 due Saturday 2:00ᴘᴍ
|
Wed Aug 24, 2011
|
- Java/C++ differences
- “That's C, not C++”
int main()
int /char /float /double /bool
- Declaration looks like use
- scope: local/global/
{}
- C++ doesn’t have a stack
|
Fri Aug 26, 2011
|
- Discuss HW1
- stack vs. heap vs. static memory
const
if /while /for
using namespace std;
<stdio.h> vs. <cstdio>
- intro to iostreams
- Casting,
old & new style
|
2
| Mon Aug 29, 2011
|
|
Using bash
| Ch. 2: Functions, Arrays, Strings, Param. Passing
| HW1 due Wednesday 2:00ᴘᴍ
|
Wed Aug 31, 2011
|
- functions
- call-by value/reference/const reference
- passing arrays
- function overloading
- default parameters
- Overloaded functions; name mangling using nm & c++filt
|
Fri Sep 2, 2011
|
- Review HW1
- vector
- member functions
- «vector::max_size(cpp)» vs. «vector::size(cpp)» vs. «vector::capacity(cpp)»
- vector vs. C-style arrays
- pointers/references and addresses, pointer scaling/arithmetic
new /delete /new[] /delete[]
- garbage collection
NULL /0
- dangling/stale pointers
- double
delete
- abandoned memory
alpha->beta vs. gamma.delta
|
3
| Mon Sep 5, 2011
| Labor Day
|
Debugging Lab
|
Ch. 3: Pointers, References, new & delete Section 11.5: Cmd-Line Arguments
|
|
Wed Sep 7, 2011
|
- Today is the last drop day
- Quiz 1
- HW2, which will be much harder than HW1.
- Command-line arguments
|
Fri Sep 9, 2011
|
|
4
| Mon Sep 12, 2011
|
struct vs. class
- data members
- function members (methods)
public /protected /private , friends
|
| Ch. 4: Classes
| HW2 due Wednesday 2:00ᴘᴍ
|
Wed Sep 14, 2011
|
|
Fri Sep 16, 2011
|
|
5
| Mon Sep 19, 2011
|
- C++ is extensible, not mutable
- Operator overloading, member vs. non-member
| Linked List Lab
| Ch. 5: Operator Overloading
|
|
Wed Sep 21, 2011
|
|
Fri Sep 23, 2011
|
|
Vertical space to separate the three parts
|
6
| Mon Sep 26, 2011
|
- Review the midterm
- Inheritance (is-a) vs. composition (has-a)
- Calling methods in base class (example)
- Base class in initialization list
copy ctor in derived class calls copy ctor in base class
operator= in derived class calls operator= in base class
typedef for base class alias instead of super
- Slicing
| Valgrind lab
| Ch. 6: Inheritance
|
|
Wed Sep 28, 2011
|
|
Fri Sep 30, 2011
|
|
7
| Mon Oct 3, 2011
|
- Copy ctor vs. operator= (example)
using Loud.h
- Member vs. non-member functions in Complex
private (lousy default)/public /protected inheritance
- Multiple inheritance
- Friendship is not inherited
- There is no
Object class.
- Not much reflection in C++:
typeid() & type_info
|
gtkmm lab
|
| HW3 due Wednesday 2:00ᴘᴍ
|
Wed Oct 5, 2011
|
|
Fri Oct 7, 2011
|
Programming paradigms:
|
8
| Mon Oct 10, 2011
|
| Coverage Lab
| Ch. 8: Abnormal Control Flow
|
|
Wed Oct 12, 2011
|
|
Fri Oct 14, 2011
|
Namespaces:
- Access a whole namespace:
using namespace std;
- Access a class:
using std::ofstream;
- Access a symbol:
using std::cout;
- The std namespace:
std::string
- The global namespace:
::bar
<math.h> vs. <cmath>
- Namespaces are open, classes are closed
std is closed, anyway
- Nested namespaces
- The anonymous namespace
- Libraries & namespaces
- Namespace aliases:
namespace HP = Hewlett_Packard;
- Symbol resolution & namespace ambiguity
|
9
| Mon Oct 17, 2011
|
ios:
- State: «ios::good(cpp)» / «ios::eof(cpp)» / «ios::fail(cpp)» / «ios::bad(cpp)»
- ios has no
open() method
- Misuse of «ios::eof(cpp)»
- Stream as a
bool / void *
| New Lab
| Ch. 9: Input & Output
| HW4 due Wednesday 2:00ᴘᴍ
|
Wed Oct 19, 2011
|
ostream:
- «ostream::put(cpp)» / «ostream::write(cpp)»
- «ostream::seekp(cpp)» / «ostream::tellp(cpp)»
- manipulators (formatted output example)
istream:
- «istream::get(cpp)» / «istream::unget(cpp)» / «istream::peek(cpp)»
istream::get() vs. cin >> c
- «istream::getline(cpp)»
- «istream::ignore(cpp)»
- «istream::seekg(cpp)» / «istream::tellg(cpp)»
|
Fri Oct 21, 2011
|
fstream:
- Misuse of «fstream::open(cpp)»
stringstream:
- «stringstream::str(cpp)»
- Using stringstream for general conversion
Serialization, lack of
|
10
| Mon Oct 24, 2011
|
RAII:
- It’s a Design Pattern
- Acquisition - Use - Release
- Use RAII when you think “Don’t forget to ...”
- Simplicity of description/state
- Immune to early return/throw
- Examples:
- autoptr to dynamic memory
- file handle / socket / database / other OS resources
- mutex (lock)
- list membership
Mixins:
- is-a, but not really
- Make the ctor/dtor
protected
- override new/delete
- noncopyable / noninstantiatable
- loudness for debugging
- timestamp
- ID number
- serialization
- Alternative ways to achieve the same goal
| IO Lab
|
|
|
Wed Oct 26, 2011
|
|
Fri Oct 28, 2011
|
|
Vertical space to separate the three parts
|
11
| Mon Oct 31, 2011
|
| Subversion Lab
| Ch. 7: Templates
|
|
Wed Nov 2, 2011
|
- Templates use Duck Typing
- A class can provide: methods, variables, constants, types
- Iterators:
|
Fri Nov 4, 2011
|
- Standard containers (STL):
|
12
| Mon Nov 7, 2011
|
- Non-standard containers:
- slist
- rope
- hash_set / hash_multiset / hash_map / hash_multimap
- unordered_set / unordered_multiset / unordered_map / unordered_multimap
- Common container methods:
- ctor(iter, iter)
- ctor(n)
- empty()
- size()
- clear()
- begin() / end() / rbegin() / rend()
| Template Specialization Lab
|
| HW5 due Wednesday 2:00ᴘᴍ
|
Wed Nov 9, 2011
|
|
Fri Nov 11, 2011
|
|
13
| Mon Nov 14, 2011
|
| Hash Lab
|
|
|
Wed Nov 16, 2011
|
|
Fri Nov 18, 2011
|
|
13½
| Mon Nov 21, 2011
| Thanksgiving Break
|
Wed Nov 23, 2011
|
Fri Nov 25, 2011
|
14
| Mon Nov 28, 2011
|
|
Alpha Op Lab Help with HW6
|
|
|
Wed Nov 30, 2011
|
|
Fri Dec 2, 2011
|
|
15
| Mon Dec 5, 2011
|
|
UML Lab Review for final exam
|
| HW6 due Monday 2:00ᴘᴍ
|
Wed Dec 7, 2011
|
|
Fri Dec 9, 2011
|
- Review for final exam
- ASCSU Surveys
|
Vertical space to separate the final exam
|
16
| Tue Dec 13, 2011
|
- Final exam 7:30–9:30ᴀᴍ, same room as lecture
|