C++ Basics Fundamentals of Computer Science
Outline Part 1: Overview Program Structure Part 2: Variables and Data Types Operators Basic Input/Output (I/O) Part 3: Control Structures Functions
Control Structures Conditional (if) Statement Example:
Control Structures Selection Statement Example:
Control Structures Iteration: while loop Example:
Control Structures Iteration: do-while loop Example:
Control Structures Iteration: for loop Example:
Control Structures Iteration: range-based for loop Example:
Functions Function Syntax: Example:
Functions Example with no return type:
Functions Pass by Value vs. Pass by Reference:
Functions Pass by Value Pass by Reference: Safe and Efficient:
Functions Default Values in parameters
Functions Declaring Functions: Any identifier – function or variable – must be declared before it is used So… can define function above main() function OR Can use a function declaration before code:
Summary Part 1: Overview Program Structure Part 2: Variables and Data Types Operators Basic Input/Output (I/O) Part 3: Control Structures Functions
Recommend
More recommend