How to use different IDE to write, compile and execute C++ programs. :
Download, install and use Code::Blocks for your C++ program under Windows.
Download, install and use Visual Studio under Windows.
Mac Users: How to use Xcode for writing C++ programs under Mac.
Mac: Using text editor and command shell for writing and executing C++ program.
Understand the first program, variables, data types, operators, taking input. :
Understand the first program that prints "Hello World" - First Part.
Understand the first program that prints "Hello World" - Second Part
Some more information on the first program.
Understand variables - how to store data in memory.
Arithmetic operations in C++ - learn how you can do arithmetic operations in C++
Take input from keyboard.
Reading Input from console and printing back.
Understand what is Explicit casting and when you need it.
lvalue, rvalue and assignment operator.
Unary increment (++) and decrement (--) operator.
Relational operators - helps to compare two values.
Logical operators - Logical AND operation.
Logical OR operation.
Logical NOT operation.
Shortcut assignment operators.
Section 3 Quiz
Character type data - ASCII values.
Convert upper to lower case character
If else and switch statement - how to do branching. :
If-else if statement - when we need to test more conditions.
Write a program to check leap year.
Write a C++ program to calculate Income Tax.
Check the age
Conditional operator - the only ternary operator in C++. Alternative to if-else
Section 4 Quiz
Loop - iterate over a section of code.
While loop. :
While Loop Test1
While loop example - C++ program to find factorial of a number.
Write another program using while loop - Find sum of numbers using while.
While loop to find sum of digits of a number.
While Loop Test2
What will happen if you put semicolon at the end of while statement.
do while loop, first do then check.
More information on for loop.
Printing multiplication table using for loop.
Fibonacci series using for loop.
Count of odd and even digits in a number.
Nested loops - one loop inside another.
Star Pattern #1
Star Pattern #2
Star Pattern #3
Finding factors of a number and chech for Prime number.
Use of break keyword within a loop.
Example program that uses break
Learn how 'continue' works within loop.
How to generate random integers in C++ program. :
How we can generate random numbers in C++ programs and how to initialize seed.
Modularise your program using function. :
Introduction to user defined function.
Passing parameters to function.
Calling a function
Function prototype declaration.
Passing Reference parameter to function.
Example showing benefit of passing reference parameter.
A function to check Armstrong Number
Write a function to check if a number is Prime number or not.
Series Sum #1
Series Sum #2
Default parameter in methods.
Function Overloading, compile time Polymorphism.
Quiz on user defined function
Understanding Pointer Basics - Part 1
Understanding Pointer Basics - Part 2
Understanding Pointer Basics - Part 3
Understanding Pointer Basics - Part 4
Understanding Pointer Basics - Part 5
Understanding Pointer Basics - Part 6
Array - basic datastructure :
Introduction to Array
Input and output operations with 1 dimensional array.
Relationship between 1D array and pointers.
How to pass array to function.
Reverse an array: ArrayExercise 4
Passing array by reference to a function.
Range for loop to traverse array.
Count above average numbers: Array Exercise 3
Count Values in range: ArrayExercise 4
Two dimensional array.
String in C++ :
Introduction to String
Different initialization options for string object.
StringTest1 : Declaration Initialization and some method
StringTest2:Accessing an element in a string
How to input string from keyboard using cin and getline
String traversal using simple for loop and range for loop.
StringTest3: Printing each character of string separately
StringTest4: count number of vowels in string
Credit Card number checking
Erasing a portion of string.
StringTest5: practice erase method
Some useful string methods.
Find operation in String - how to search a target in string object.
find_first_of operation - Another useful string search method.
Comparing string with another string.
replace method of string - useful when you need to replace a portion of string.
StringTest: find and replace
The substring method to extract a portion of string.
istringstream - super utility.
ostringstream - super utility
Quiz on string
Reading and Writing with text files :
Writing into a text file.
Writing to text file
Write some structured data into file
Reading from text file.
File reading exercise 1
Part 1 - Reading and parsing structure data from text file
Part 2 - Reading and parsing structure data from text file
Part 3 - Reading and parsing structure data from text file
Find BMI of teen agers
Dynamic memory allocation in C++ :
Part 1: Dynamic memory allocation.
Part 2: Dynamic memory allocation - Why we need to deallocate, memory leak.
Part 3: Dynamic memory allocation, Dangling Pointer.
Quiz on Dynamic memory allocation
Library vector class of C++ - Super Utility :
Part 1: Introduction to vector.
Part 2: Vector capacity vs size
Part 3: Vector constructor
Get the first and last element of a vector
push some values into a vector
Part 4: Vector iterator and some useful methods of vector.
Get the iterator
Return reverse iterator for second last element of a vector.
Testing vector operations
Part 5: data method of vector
Quiz on vector
structure in C++ - C style user defined type creation. :
Part 1: Introduction to struct
Part 2: How to write operations for struct objects, passing objects to function.
Part 3: Continuation of the previous lecture.
Part 4: struct pointer
Part 5: Array of struct objects.
Part 6: Vector of struct objects.
Initialize structure object
Find the maximum distance
Quiz on Structure
A mini project :
Part 1: Understand what we are going to develop.
Part 2: Starting the project
Part 3: Mini project.
Part 4: Mini project.
Part 5: Mini project.
Part 6: Mini project.
Part 7: Mini project.
Part 8: Mini Project.
Object oriented programming using C++ :
Creating User Defined Types - Understanding the properties and behaviours.
The class keyword - private and public members and their significance.
Let us now start writing the Car class.
Understanding Constructor method.
Let us complete the Car class.
Recap - class, private, public, abstraction, objects, properties, behaviours.
this pointer - You must know about this.
Separating class declaration and definition in different files. :
Using Code::Blocks writing class declaration and implementations separately.
Using Visual Studio separate class declaration and definition.
Using Xcode on Mac to write declaration and definition in separate files.
Using simple text editor and makefile
Download, install make under windows.
Write a class.
Write more methods for a class
Operator Overloading. :
Operator Overloading Introduction.
Overloading arithmetic + and - operators.
Overloading unary increment (++) and unary decrement (--) operator.
Overloading extraction >> operator.
Overloading relational operators.
Overloading assignment operator.
Having dynamic member of a class - Let's write a vector of our own. :
How we can write a vector of our own-idea of dynamic memory for instance member.
Writing push_back method for our vector class.
Overloading the subscription operator .
Overloading insertion operator for our vector.
Writing destructor and why it is required this time.
Part 1: Writing assignment operator and copy constructor
Part 2: Writing assignment operator and copy constructor
Using template to write generic code. :
Let us make the vector of previous section generic using template.
Inheritance - The strongest feature of Object Oriented Programming. :
Part 1: Inheritance - Basic concept
Part 2: Understanding using a practical example.
Part 3: Managing constructor in Inheritance - constructor redirection.
Part 4: Super-type pointer and sub-type object - Dynamic polymorphism.
Part 5: Dynamic Polymorphism in depth - how it helps.
Part 6: Concept of pure virtual function.
Part 7: Another example that uses pure virtual function and dynamic polymorphism
Part 8: Concept of interface - a class with all abstract behaviours.
Exception Handling in C++ :
Introduction to Exception Handling
Handling exception using try catch block.
How to throw exception from function using throw keyword.
Writing more than one catch block to handle different types of exception.
Writing custom exception class.
STL - Standard Template Library :
Introduction to Standard Template Library (STL)
STL Container Overview
Common methods for all STL containers.
Common methods for Sequence Containers
STL - The list container. :
Introduction to List - Sequential but discrete representation of elements
Some important methods of list
List iterators vs vector iterators
emplace method - Create and insert object in one step
Function Pointers, Functors and Algorithm. :
Understand function pointers.
Function pointers in action - let's write program that uses function pointer
Functors - Intro and why we prefer functors ober function pointers.
Creating a base class for implementing functor
Algorithm - count_if and functor
Algorithm - remove_if and functor
Algorithm - transform and functors
Algorithm - more hands on examples on transform.
Algorithm - for_each and functor with example.
Lambda in C++ :
Introduction to Lambda - alternative to functor.
Lambda - how to capture locals by value.
Lambda - how to capture locals by reference.
Binary functors - operator() that receives 2 parameters
Sorting elements of a container - sort algorithm
STL continues - Forward List and Array container. :
Forward list - another sequence container.
STL array class - a fixed sequence container.
STL - deque and stack :
STL stack class
Stack in Action - Let's develop a parentheses checker - Part 1
Stack in Action - Let's develop a parentheses checker - Part 2
The pair structure - useful utility.
STL - associative containers - map, multimap, unordered_map. :
Associative container - Introduction to map. How to declare, insert and traverse
Map - Part 2 continues, supplying custom comparator for ordering keys.
Map - part 3: finding a key, deleting key
Multimap - Introduction, declaration, insertion and traversal.
Multimap - part 2: finding key using find and equal_range method, deleting.
Multimap - part 3: how to update multimap entries.
Unordered map - Part 1: Introduction, declaration, insertion, find, erase, usage
Unordered map - Part 2: idea of hashing in unordered map, custom hash function.
Bonus Section :
Coupon links to my other courses.
There are currently no items in your shopping cart.