- Lecture Notes: link
- Jupyter notebook: colab
- Cheat Sheet: cheatsheet
- Installation guide here
- C++ is similar in syntax to Java
- Review Java syntax
- C/C++ is not an inherently objected oriented language
Hello world in C++
#include<iostream> // Needed for input and output
using namespace std; // Standard library of C++
int main(){ //program entry point
cout << "Hello World"<<endl;
return 0;
}Function declaration vs function definition
- Prime number Code
- Write prime numbers to a text file Code
- Solve GCD Problem Description
- use Files File
- Tic Tac Toe
- Call by reference and by value
- vector
- size(), constructor, [], push_back
- Random number
- rand(), RAND_MAX
- simulate dice
- estimate
$\pi$ 1.
- arguments in programs i.e., argc, argv
- work with bitmap images header,test code
- In class practice on Wedednsday
- Tutorial for deque
-
Classes tutorial
-
Multiple files (project across multiple files) cat
-
virtual methods
-
Scott Meyers, in Effective C++, provides a useful guideline:
if a class has any virtual function, it should have a virtual destructor, and that classes not designed to be base classes or not designed to be used polymorphically should not declare virtual destructors.
-
Classes II tutorial
-
Midterm Review review
-
Questions from midterm:
- worked on complex numbers
- simdjson, quick start
- vector implementations
- OSM Project: quick start
- lambda
Footnotes
-
There are other forumlas to compute $\pi$, such as $\pi = 4 \times \sum_{n=0}^{\infty} \frac{(-1)^n}{2n + 1}$ ↩