C++ Notes: Table of ContentsFred: C++ Notes: Table of ContentsSome of these supplemental notes are good, others only rough drafts or half-completed. Because they are designed only to provide additional examples, summaries, or explanations where the textbook is weak, they do not cover many obviously important topics. You can download a zipped version: notes-cpp-2004-12-19.zip [less than 400 KB]. -- Fred
Getting Started
- Development Systems
- Model programs
- Misc
Summaries
Types and Expressions
Types
- Integers (
int
,short
,long
,char
)
- Floating Point (
float
,double
,long double
)
- Characters (
char
)bool
- Enums
Expressions
Control Flow
Loops
- Examples
- Programming Problems - Reading from
cin
- Programming Problems - Writing from a loop
- Programming Problems - Nested loops
Switch Statement
Functions
- Function Concepts
- Function Structure
- Function
return
Statement- Function Parameters
- Function Call Order
- Function Reference Parameters
- Programming Problems
Exceptions
- try - catch
- Standard exceptions
- Exception test
Input / Output
- Example: File open dialog
- I/O operators - <<>>
- I/O manipulators
- String streams
- String stream example
- Idiom - Separate User Interface from Logic
GUI
Arrays
One-dimensional Arrays
- Arrays
- Array Examples
- Array Memory Diagrams
- Array Initialization
- Passing Array Parameters
- Arrays - Problems and Solutions
- Arrays - Buffer overflow
C-Strings - arrays of char
- C-Strings (arrays of chars)
- Common
functions - C-string Prog exercises 1
- C-string Prog exercises 2
Here are solutions to a few problems, using separate source files.2-dimensional arrays
Battleship Example
Sorting Arrays
- Sorting
- Sort efficiency
- Bubble Sort - Fixed passes
- More Bubble Sorts
- Selection Sort
- isSorted
- STL sort for arrays
Searching Arrays
Misc Array Function Examples
Misc practical issues.
Multiple source files
Pointers, References, and Dynamic Allocation
Pointers and References
- Addresses, pointers, references
- Pointers
- The NULL pointer
- Pointer quote
- The Name of the Song is ...
- swap - references, pointers, STL, templates
Pointers, arrays, and subscripts
Dynamic allocation (new, delete)
Structs
Examples
- Classical (non-OOP) Linked Lists
- Binary Search Trees
- Expression Trees
Object-Oriented Programming with Classes
- OOP
- Classes
- Data members
- Constructors and Destructors
- Operator Overloading
- Member functions
- Friend functions
- Inheritance
- Nothing yet
Generic Programming
- Templates
- Template functions
- Nothing yet
STL (Standard Template Library) containers, iterators, algorithms
General
Containers
- General information
- Sequence containers
- Common Sequence Container Operations
- Strings
- Vectors
header - Example - Vector reverse input
- Example - RPN (Reverse Polish Notation) calculator
- Passing Vector Parameters
- Iterators for vector
- Crossword Helper - uses
vector
,string
,ifstream
.- Lists
- Deques
- Associative containers
- Maps, Multimaps
- Sets, Multisets
- Adapter containers (based on other containers)
- Stacks
- Queues
- Priority Queues
Iterators
Examples
- Lefthand
- Lefthand 1 - uses
string
.- Lefthand 2 - uses
string
andvector
.- Lefthand 3 - uses
string
andset
.- Compress - Uses vector, string, sort.
- Printing input words in reverse order
- Using array - for comparison.
- Using
vector
andstring
- Using
stack
andstring
Misc Examples
Misc
Random numbers
Preprocessor
Big-Oh Notation
Other online sources
- www.cppreference.com - Function references.
- www.codeproject.com - Many articles from beginner to advanced. Very interesting.
- www.bruceeckel.com has both volumes of Bruce Eckel's excellent Thinking in C++ books. Yes, the entire books are there! These aren't for real beginners, but after you've had a little bit of C++ programming, these will be very useful.
- www.cplusplus.com/doc/tutorial
- publications.gbdirect.co.uk/c_book/ Has made an entire 1991 C book online freely available.
Pages
Welcome~~~
This blog: http://alg-code.blogspot.com/
It is easier to write an incorrect program than understand a correct one.
Monday, February 14, 2011
C++ Notes: Table of Contents
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment