#include #include /* requires -std=c++14 */ using namespace std; void f(int x,int y) { int z = x; x = y; y = z; // } void f2(int* x, int *y) { int z = *x; *x=*y; *y=z; } constexpr int zz() { int x = 0; while (x<5) x++; return x; } struct account { double balance; account(double b) : balance{b} {} void transaction(double amt) { if (balance + amt >0 ) balance += amt; } double inquiry() { return balance; } }; // STATIC (compile time) versus DYNAMIC (runtime) int main() { account a1(500); account* a2 = new account(600); unique_ptr a3 = make_unique(800); a3 = make_unique(860); unique_ptr a3b = move(a3); shared_ptr a4 = make_shared(900); delete a2; /* const int z = zz(); cout << 1/(z-5); int x=1, y=2; //f(x,y); f2(&x,&y); cout << x << " and " << y << endl; int A[10]; int B[20]; for(int i = 0; i<15000;i++) i[A] = 99999; // i[A] == *(i+A) == A[i] for(int x:A) cout << x << " "; cout << endl << B[1] << endl; */ }