CS253

CS253: Software Development with C++

Spring 2009

Schedule

Class Schedule

Week Date Lecture Recitation Reading Homework
1 Wed Jan 21
  • Help with HW0
  • Logging in
  • Editing files
  • Using g++

Attend as needed this week only

Ch. 0: Introduction
Ch. 1: Basic Types & Control Structures

Do the reading before class for the week.

HW0: Due Saturday 11:00AM
Fri Jan 23
  • “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
  • stack vs. heap vs. static memory
  • intro to iostreams
  • const
  • if/while/for
  • using namespace std;
  • <stdio.h> vs. <cstdio>
  • casting, old & new style
2 Mon Jan 26
  • functions
  • call-by value/reference/const reference
  • function overloading
  • default parameters

Using bash

Ch. 2: Functions, Arrays, Strings, Param. Passing HW1 due Thursday 11:00AM
Wed Jan 28
Fri Jan 30
  • ‡vector‡
  • ‡vector‡ vs. C-style arrays
3 Mon Feb 2
  • 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

Debugging Lab

Ch. 3: Pointers, References, new & delete
Section 11.5: Cmd-Line Arguments

 
Wed Feb 4
Fri Feb 6
4 Mon Feb 9
  • struct vs. class
  • data members
  • function members (methods)
  • public/protected/private, friends
Make Lab Ch. 4: Classes HW2 due Thursday 11:00AM
Wed Feb 11
Fri Feb 13
  • initializer lists
  • static members
  • const member functions
  • conversion functions
  • explicit
5 Mon Feb 16
  • C++ is extensible, not mutable
  • Operator overloading, member vs. non-member
Linked List Lab Ch. 5: Operator Overloading  
Wed Feb 18
  • Review for midterm
Fri Feb 20
  • First midterm
6 Mon Feb 23
  • Review the midterm
  • Inheritance (is-a) vs. composition (has-a)
  • Calling methods in base class
  • 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 Feb 25
  • Discuss HW3
  • operator++ & operator++(int) in Complex
  • Polymorphism
  • Virtual functions / virtual dtors
  • dynamic dispatch
  • ‡dynamic_cast‡
Fri Feb 27
7 Mon Mar 2
  • 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 Saturday 11:00AM
Wed Mar 4
Fri Mar 6

Programming paradigms:

8 Mon Mar 9 Coverage Lab Ch. 8: Abnormal Control Flow  
Wed Mar 11
Fri Mar 13
  • Of course there will be a curve—it’s impossible to avoid one.
  • Last withdrawal is “next” Monday.

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
S p r i n g   B r e a k !
9 Mon Mar 23

‡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 Thursday 11:00AM
(delayed to Saturday 11:00AM due to CSU snow closure)

Wed Mar 25

‡ostream‡:

  • ‡ostream::put‡ / ‡ostream::write‡
  • ‡ostream::seekp‡ / ‡ostream::tellp‡
  • manipulators

‡istream‡:

  • ‡istream::get‡ / ‡istream::unget‡ / ‡istream::peek‡
  • istream::get() vs. cin >> c
  • ‡istream::getline‡
  • ‡istream::ignore‡
  • ‡istream::seekg‡ / ‡istream::tellg‡
Fri Mar 27

‡fstream‡:

  • Misuse of ‡fstream::open‡

‡stringstream‡:

  • ‡stringstream::str‡
  • Using stringstream for general conversion

Serialization, lack of

10 Mon Mar 30

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 Apr 1
  • Review for midterm
Fri Apr 3
  • Second midterm
11 Mon Apr 6 Subversion Lab Ch. 7: Templates  
Wed Apr 8
  • Review second midterm
  • 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
  • Discuss HW5
Fri Apr 10
  • Standard containers (STL):
    • ‡string‡
    • ‡vector‡
    • ‡list‡
    • ‡set‡ / ‡multiset‡
    • ‡map‡ / ‡multimap‡
    • ‡deque‡ (oddly, not dequeue)
    • ‡stack‡
    • ‡queue‡
12 Mon Apr 13
  • 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 Thursday 11:00AM
Wed Apr 15
  • ‡pair‡ and ‡make_pair‡
  • ‡algorithm‡s
  • functors
Fri Apr 17
  • More ‡algorithm‡s
13 Mon Apr 20
  • More ‡algorithm‡s
  • Case study: die
Hash Lab    
Wed Apr 22
  • Quiz 3
  • Discuss HW6
Fri Apr 24
  • Interface between a container & iterator
  • How best to approach HW6
14 Mon Apr 27

Alpha Op Lab
Help with HW6

HW6 due Saturday 11:00AM
Wed Apr 29
  • 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 May 1
15 Mon May 4

UML Lab
Review for final exam

 
Wed May 6
Fri May 8
  • Review for final exam
  • ASCSU Surveys
16 Mon May 11
  • Final exam 7:00AM–9:00AM, same room as lecture

Modified: 2009-05-03T23:15

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building