Lecture 1: Introduction to C++
- Course policies and goals
- Scheme and C++
- Basic C++ types and operations
Scheme and C++
- functional versus object-oriented
- Evaluate expressions versus execute commands
- interpreted (at least Dr. Scheme) versus compiled
- Declaration versus details
- types
Some history
- C: invented in early 1970's by K & R for Unix systems programming
- General purpose, efficient, but generally "high-level assembly"
- C++: developed by Stroustrop in early 1980s to implement OOP
- C++ grown by accretion rather than design (cf Java)
Basic things that go into C++ programming
- text editor
- text files that contain the program (source files)
- header files with declarations
- Compiler
Some simple programs
- Hello world
- Basic arithmetic expressions
- values versus locations (data, pointers, references)
C++ data types
- integer:
bool,short,int,long
- floating point:
float,double
- addresses of/references to any type (exposes the computer's memory to the
programmer)
- arrays of any type
- structures/objects
C++ operations
- Arithmetic on numeric types
- Pointers:
- Address, dereference operators
- Pointer arithmetic
- Printing
- cout,cin,cerr (C++)
- printf (C)