Week
| Date
| Lecture
| Recitation
| Reading
| Homework
|
1
| Mon Aug 23, 2010
|
|
- 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 25, 2010
|
- 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 27, 2010
|
- 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 30, 2010
|
|
Using bash
| Ch. 2: Functions, Arrays, Strings, Param. Passing
| HW1 due Wednesday 2:00ᴘᴍ
|
Wed Sep 1, 2010
|
- functions
- call-by value/reference/const reference
- passing arrays
- function overloading
- default parameters
- Overloaded functions; name mangling using nm & c++filt
|
Fri Sep 3, 2010
|
- Review HW1
- ‡vector‡
- member functions
- ‡vector::max_size‡ vs. ‡vector::size‡ vs. ‡vector::capacity‡
- ‡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 6, 2010
| Labor Day
|
Debugging Lab
|
Ch. 3: Pointers, References, new & delete Section 11.5: Cmd-Line Arguments
|
|
Wed Sep 8, 2010
|
- Today is the last drop day
- Quiz 1
- HW2, which will be much harder than HW1.
- Command-line arguments
|
Fri Sep 10, 2010
|
|
4
| Mon Sep 13, 2010
|
struct vs. class
- data members
- function members (methods)
public /protected /private , friends
|
| Ch. 4: Classes
| HW2 due Wednesday 2:00ᴘᴍ
|
Wed Sep 15, 2010
|
|
Fri Sep 17, 2010
|
|
5
| Mon Sep 20, 2010
|
- C++ is extensible, not mutable
- Operator overloading, member vs. non-member
| Linked List Lab
| Ch. 5: Operator Overloading
|
|
Wed Sep 22, 2010
|
|
Fri Sep 24, 2010
|
|
Vertical space to separate the three parts
|
6
| Mon Sep 27, 2010
|
- 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 29, 2010
|
|
Fri Oct 1, 2010
|
|
7
| Mon Oct 4, 2010
|
- 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 Help with HW3
|
| HW3 due Wednesday 2:00ᴘᴍ
|
Wed Oct 6, 2010
|
|
Fri Oct 8, 2010
|
Programming paradigms:
|
8
| Mon Oct 11, 2010
|
| Coverage Lab
| Ch. 8: Abnormal Control Flow
|
|
Wed Oct 13, 2010
|
|
Fri Oct 15, 2010
|
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 18, 2010
|
‡ios‡:
- State: ‡ios::good‡ / ‡ios::eof‡ / ‡ios::fail‡ / ‡ios::bad‡
- ios has no
open() method
- Misuse of ‡ios::eof‡
- Stream as a
bool / void *
| New Lab
| Ch. 9: Input & Output
| HW4 due Wednesday 2:00ᴘᴍ
|
Wed Oct 20, 2010
|
‡ostream‡:
‡istream‡:
- ‡istream::get‡ / ‡istream::unget‡ / ‡istream::peek‡
istream::get() vs. cin >> c
- ‡istream::getline‡
- ‡istream::ignore‡
- ‡istream::seekg‡ / ‡istream::tellg‡
|
Fri Oct 22, 2010
|
‡fstream‡:
- Misuse of ‡fstream::open‡
‡stringstream‡:
- ‡stringstream::str‡
- Using stringstream for general conversion
Serialization, lack of
|
10
| Mon Oct 25, 2010
|
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 27, 2010
|
|
Fri Oct 29, 2010
|
|
Vertical space to separate the three parts
|
11
| Mon Nov 1, 2010
|
| Subversion Lab
| Ch. 7: Templates
|
|
Wed Nov 3, 2010
|
- Templates use Duck Typing
- A class can provide: methods, variables, constants, types
- Iterators:
- ‡InputIterator‡
- ‡OutputIterator‡
- ‡ForwardIterator‡
- ‡BidirectionalIterator‡
- ‡RandomAccessIterator‡
- begin / end
- Don’t compare using
<
- Invalidation
|
Fri Nov 5, 2010
|
- Standard containers (STL):
- ‡string‡
- ‡vector‡
- ‡list‡
- ‡set‡ / ‡multiset‡
- ‡map‡ / ‡multimap‡
- ‡deque‡ (oddly, not dequeue)
- ‡stack‡
- ‡queue‡
|
12
| Mon Nov 8, 2010
|
- 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 10, 2010
|
- ‡pair‡ and ‡make_pair‡
- ‡algorithm‡s
- functors
|
Fri Nov 12, 2010
|
|
13
| Mon Nov 15, 2010
|
- Review HW5
- More ‡algorithm‡s
- Case study: die
| Hash Lab
|
|
|
Wed Nov 17, 2010
|
|
Fri Nov 19, 2010
|
|
13½
| Mon Nov 22, 2010
| Thanksgiving Break
|
Wed Nov 24, 2010
|
Fri Nov 26, 2010
|
14
| Mon Nov 29, 2010
|
|
Alpha Op Lab Help with HW6
|
|
|
Wed Dec 1, 2010
|
- Input/Output/Inserter Iterators:
- ‡istream_iterator‡
- ‡ostream_iterator‡
- ‡insert_iterator‡ ‡inserter‡
- ‡front_inserter‡ ‡back_inserter‡
- Standard functors:
- ‡plus‡ ‡minus‡ ‡multiplies‡ ‡divides‡
- ‡negate‡
- ‡less‡ ‡greater‡ ‡less_equal‡ ‡greater_equal‡ ‡equal_to‡ ‡not_equal_to‡
- ‡logical_and‡ ‡logical_or‡ ‡logical_not‡
|
Fri Dec 3, 2010
|
|
15
| Mon Dec 6, 2010
|
|
UML Lab Recitation 15 Program Files Review for final exam
|
| HW6 due Monday 2:00ᴘᴍ
|
Wed Dec 8, 2010
|
|
Fri Dec 10, 2010
|
- Review for final exam
- ASCSU Surveys
|
Vertical space to separate the final exam
|
16
| Thu Dec 16, 2010
|
- Final exam 3:40–5:40ᴘᴍ, same room as lecture
|