Intro to C++
I plan on posting notes here with some basic projects to show my understanding of concepts in C++
After Learning Python the past year, C++ syntax looks so funky, but after a few weeks, it’s not too bad! so far..
Week 1: C++ and Types
- Variables, Literals, and Constants
- Data Types (Int, Strings, Char)
- Basic Input and Output
- Type Conversion
Week 2: Control Conditionals and References
- Operators (adding, dividing, etc)
- if statements, for loops, switch, and while loops
- break and continue
- References vs Pointers
Week 3: Functions
- Intro to Functions
- Function Types and Overloading
- Function Return
- Recursion
Week 4: Strings and Type Modifers
- Chars (‘’) and Strings (“”)
- Type Modifers
- const
Week 5: Functions and Multiple File Compilation (working with Headers)
- Working with Declerations and Definitions
Working with Multiple Files (Headers) in C++
Week 6: Vectors, Exceptions, and String Stream (importing txt files)
- Opening Files (txt) and writing to files
Working with txt files and Streams
-
Reading txt file, using getline() and ifstreams
-
ostringstream and istringstream
- Working with vectors
- How to print vectors
- 2-D vectors
- try and catch
Week 7: Generic Algorithms and Iterators
-
Non-Modifying: find, find_if, search, accumulate
-
Modifying: copy, transform
-
Removing
-
Mutating (elements) : sorting
-
Lambdas
- iterating using Strings and Vectors
- iterating using Maps and Sets
Week 8: Associative Containers and Streams
- Pairs, make_pair,
- Maps
- Different way to insert into a Map
- Set Union, Set intersection, and Symmetric Difference
- Buffers
- istream and ostreams
- File Streams
Week 9: Introduction to Classes
- Introduction to Composition, Abstraction, Encapsulation, Inheritance, and Polymorphism
Week 10: More on Classes
- Constructors
- Different Examples
- explicit
Week 11: Encapsulation
- Getters and Setters
- Abstraction
- Friend functions
- Operator Overload in C++
- Intro the Rule of Three
- working with this pointer in C++
- For classes/objects
- Pointer to C++ Classes
- const member functions
- Examples of Overloaded operators in C++
Week 12: Arrays
- Define, Declare and Accessing Arrays
- Data Structures
- Arrays and Pointers
- Arrays and Functions
- Dynamic Memory
- Leaking Memory
Week 13: Even more on Classes
- More on Rule of Three Review
- Composite Class
- Bad Dynamic Memory Class
- Fixing Bad Memory
- Templates and Classes
- Templated Friends
Week 14: Finshing up
- Wrapping up C++
- What I haven’t cover yet
Extras:
- What are Pointers?
- What is the Difference Between Pass By Pointer and Pass By Pointer Reference (int * and int * &) C++
- What is the Difference Between Pass By Value, Pass By Reference, and Pass By Pointer, C++
- What is the Difference Between a Pointer and a Reference C++
Random Labs
Projects:
Project 1
Objectives: Intro to C++, Input and Output, using Data Types
Goal: Simple Program to input temperature and convert it
Project 2
Objectives: Loops, Conditionals
Goal: Hyper number solver
Project 3
Objectives: Loops, Conditionals, and the introduction of Functions
Goal: Create a function that performs different math equations
Project 4
Objectives: Working with Strings and more on Functions
Goal: Create a program that will encode a sequence of strings!
Project 5
Objectives: Working with Strings, Functions, Multiple Files (header files)
Goal: Creating a Four-Square Cipher to hide a messsage!
Project 6
Objectives: Working with Vectors, Functions
Goal: Creating another Decoding thing
Project 7
Objectives: Working with importing text files, Maps, and Sets
Goal: Connect and Disconnect from Servers
Project 8
Objectives: Create your own Data Structure using Struct
Goal: Working with OOP
Project 9
Objectives: Working more with classes (building a Finite State Automation/Finite State Machine)
Goal: Working with building our own data structures and OOP concepts
Project 10
Objectives: Building a BiStack data structure
Goal: Working with OOP, Building Data Structures, Templated Classes, etc
coming soon…
Project 11
Objectives:
Goal: Working with OOP