Cplusplus Programming Step By Step

Tags: C++

Start with basics of C++ (v11 and v14) then master File I/O, Object Oriented Programming or OOP, STL, Functors, Lambda

Last updated 2022-01-10 | 4.2

- On completing the course you will have firm grip on C++ language. You will understand the object oriented programming OOPs concept in depth.
- You will understand the basic programming structures like branching and looping.
- You will understand details about pointers and dynamic memory allocation along with memory management techniques.

What you'll learn

On completing the course you will have firm grip on C++ language. You will understand the object oriented programming OOPs concept in depth.
You will understand the basic programming structures like branching and looping.
You will understand details about pointers and dynamic memory allocation along with memory management techniques.
You will understand all about functions
parameter passing by value and by reference.
All about user defined types using struct and class. Constructor function
method overloading and dynamic polymorphism.
You will learn operator overloading
friend functions.
In depth understanding of Inheritance and dynamic polymorphism
how runtime polymorphism helps to write more flexible and dynamic code.

* Requirements

* You do not need to have any prior knowledge of programming. This is for absolute beginners.
* You only need to know how to create a folder and how to save files in folder in any operating system like Mac or Windows.
* You can start writing C++ program using any text editor like Notepad or Notepad++ or Sublime text or Atom
* You can also use advance IDEs like Visual Studio or Xcode or Code::Blocks - I will demonstrate how to download and install each of them - No Worries.
* You will also need C++ compiler - I will demonstrate how to install C++ compiler on your system at the beginning.
* You can also use online C++ compiler to compile and execute your program.

Description

This course will teach you C++ from scratch upto advance level step-by-step with Object oriented programming (OOP ) using C++11/14. The object oriented programming concepts are clearly explained, you will learn classes, objects, inheritance, runtime polymorphism, Operator overloading apart from basic programming concepts like variables, branching and looping, functions, reference parameters, arrays, string and vectors in C++.
File I/O has been discussed in details and in the Mini project File I/O is used extensively.

You will learn STL or standard template library in detail along with concept of functors and lambda.

The approach is 100% practical, hands on experience of learning will help you to get more confidence with C++ programming. You can follow me along side doing the programs in C++ and that will be best way to do the course.


Who this course is for:

  • This course is for absolute beginners in programming. No previous knowledge in programming required.
  • Beginner in programming and looking forward to start a career as a programmer, this course is for you. It is always recommended to start with C++ as it is a perfect blend of procedural and Object oriented programming.
  • If you have C++ in your school or college curriculum then this course will perfectly match your need. This course is designed according to the academic syllabus of the college curriculum.
  • You want to be a game programmer but you are kind of confused about the programming language to start with then start with C++ a natural choice for unreal engine.

Course content

30 sections • 247 lectures

Download Install and Use Code::Blocks IDE for your Windows Operating System. Preview 13:52

If you are using Windows and want to know how to Download, install and use Code::Blocks IDE then please watch this lecture. Here apart from download and installation procedure, you will also learn how to create a C++ project within Code::Blocks and how to compile and execute C++ project under Code::Blocks.

Download, install and use Microsoft Visual Studio 2019 Community edition. Preview 12:09

If you are using Windows and want to know how to Download, install and use Visual Studio 2019 IDE then please watch this lecture. Here apart from download and installation procedure, you will also learn how to create a C++ project within Visual Studio Community Edition 2019 and how to compile and execute C++ project under Visual Studio.

Mac Users: How to use Xcode for writing C++ programs under Mac. Preview 06:29

Here you will see how you can download, install and use Xcode IDE for writing C++ programs under Mac OS.

Mac: Using text editor and command shell for writing and executing C++ program. Preview 14:42

Learn how you can use a text editor like Sublime Text (or any other text editor you like) to write your C++ program and how to compile and execute from command shell (Terminal). You will get to know how to setup the 'Path' parameter for gcc compiler under Windows as well.

Understand the first program that prints "Hello World" - First Part. Preview 09:57

Let's start understanding the first program. This is the first part.

Understand the first program that prints "Hello World" - Second Part Preview 15:34

Understanding the first program continues - this is second part.

Some more information on the first program. Preview 02:21

You need some more information on the first program that I missed.

Print "Awesome"

Understand variables - how to store data in memory. Preview 09:06

Understand variables and data types. Learn how your program can keep data in the memory.

Reference variable. Preview 04:24

Understand what is reference variable and how that can be declared. This is a special C++ way.

Arithmetic operations in C++ - learn how you can do arithmetic operations in C++ Preview 05:49

Here in this lecture you will learn all the available arithmetic operators in C++.

Take input from keyboard. Preview 05:47

Learn how to take input from keyboard in a C++ program.

Reading Input from console and printing back.

In this assignment you will write a program to read input data using cin into variables and then you will write instructions to print them back into console using cout.

Understand what is Explicit casting and when you need it. Preview 04:30

lvalue, rvalue and assignment operator. Preview 03:39

Some useful information about assignment operator. You will learn about lvalue and rvalue.

Unary increment (++) and decrement (--) operator. Preview 09:18

These two Unary operators are extensively used in C++, you must have clear concept on how they are used.

Relational operators - helps to compare two values. Preview 08:57

Learn all about the following relational operators:

>, <, >=, <=, == and !=

They are extensively used while comparing 2 values in C++.


Logical operators - Logical AND operation. Preview 06:37

Introduction to logical operation. You will learn all about logical AND operation apart from general idea of logical operation in detail.

Logical OR operation. Preview 03:48

Learn how logical OR works with example.

Logical NOT operation. Preview 04:10

Learn how logical NOT operation works with example.

Shortcut assignment operators. Preview 02:00

All these shortcut assignment operators like +=, -= and so on are used extensively, learn about them in details with example.

Arithmetical Operators

Section 3 Quiz

This quiz contains questions to test your understanding for this section.

Character type data - ASCII values. Preview 05:45

Learn how you can store a single character using char data type.  You will also get idea about ASCII values.

Character variable

Convert upper to lower case character

If-else statement. Preview 06:48

Learn all about if-else statement with example.

If-else if statement - when we need to test more conditions. Preview 02:49

When we have more than one condition to test and only one could be true then we use if-elseif ladder. Understand with example.

Write a program to check leap year. Preview 13:35

Write a C++ program using if else statement to check if a given year is leap year or not.

Write a C++ program to calculate Income Tax. Preview 08:46

This lecture will demonstrate how to write a C++ program using if-else-if statement to calculate income tax when the tax slabs are given.

Check the age

Conditional operator - the only ternary operator in C++. Alternative to if-else Preview 11:41

You will learn how you can use the conditional operator as an alternative to if-else statement. This is the only ternary operator available in C++.

switch-case statement Preview 11:07

Learn how you can use switch case statement as an alternative to if-else also you will understand when switch case will be good to use.

Section 4 Quiz

Test your understanding on if-else and switch case statements

While loop. Preview 07:11

Learn the syntax and working of while loop.

While Loop Test1

While loop example - C++ program to find factorial of a number. Preview 08:02

See how you can use while loop to find the factorial of an integer number. A good example to understand while loop.

Write another program using while loop - Find sum of numbers using while. Preview 07:35

Here is another program that will help you to grasp the idea of looping more clearly. In this program we will use a while loop to add all the integer numbers given until user types in 0 to terminate.

While loop to find sum of digits of a number. Preview 08:27

In this lecture I will show you how to find the sum of digits of an integer number using while loop.

While Loop Test2

What will happen if you put semicolon at the end of while statement. Preview 03:17

Learn what will happen if you terminate the while loop using a semicolon.

do while loop, first do then check. Preview 10:52

do while loop is another loop statement available in C++ that you can use while you need to execute the termination condition after iterating the loop body that is at the end of each iteration.

For loop Preview 06:22

Introduction to for loop, understand how for loop works and the syntax.

More information on for loop. Preview 08:12

Understand how you can use the initialization section and modifier section to write more than one statements separated with comma operator. This will make your for loop more smart.

Find Factorial

Printing multiplication table using for loop. Preview 01:40

Here is a demonstration of simple program that uses for loop to print multiplication table.

Fibonacci series using for loop. Preview 06:40

See how can we use for loop to print Fibonacci series.

Count of odd and even digits in a number.

Nested loops - one loop inside another. Preview 05:12

Learn how the nested loop works.

Star Pattern #1

Star Pattern #2

Star Pattern #3

Finding factors of a number and chech for Prime number. Preview 10:56

Learn how you can use a for loop to find the factors of a given number and how to check if the number is Prime or not.

Use of break keyword within a loop. Preview 03:41

Learn how the break works within a loop to take the control out of the loop immediately and how and when that can  be used.

Example program that uses break Preview 10:02

This program will use break keyword within a loop to check if a number is prime number of not.

Learn how 'continue' works within loop. Preview 03:52

How to use 'continue' within a loop to skip the rest of the loop.

Loop

This section quiz will test your understanding on loop statements. Please complete watching all the video lectures before you attempt this quiz.

How we can generate random numbers in C++ programs and how to initialize seed. Preview 05:24

Learn how you can generate random integer numbers in C++ program.

Introduction to user defined function. Preview 08:47

You will get idea of how user defined function works and how the control moves to the function and returns back to caller.

Passing parameters to function. Preview 13:05

Understand how you can pass parameters to function. 

Calling a function

Function prototype declaration. Preview 05:26

Learn about function prototype or signature, why it is required and how to do this.

Passing Reference parameter to function. Preview 06:17

This lecture will teach you how to pass reference parameter to a function.

Reference Parameter

Example showing benefit of passing reference parameter. Preview 06:21

This lecture will show you how the reference parameter becomes useful in some cases.

A function to check Armstrong Number Preview 13:37

Function writing example - here in this tutorial I will teach you how to write a function to check if a number is Armstrong Number

Write a function to check if a number is Prime number or not. Preview 07:14

Here I will show you how you can write a function to check if a number is Prime number or not.

Primorial

Series Sum #1

Series Sum #2

Tribonacci Series

Default parameter in methods. Preview 04:05

In C++ we can have default values for parameters in functions/ methods. Learn how to do that in this lecture.

Function Overloading, compile time Polymorphism. Preview 05:21

This is a powerful feature that helps us to write different versions of the same name function. You must know this feature.

Quiz on user defined function

This quiz will test your understanding on the subject user defined function. Please watch entire section video tutorial and then attempt this quiz.

Understanding Pointer Basics - Part 1 Preview 08:17

Basic understanding of pointer, memory address.

Understanding Pointer Basics - Part 2 Preview 09:34

Understanding Pointer Basics - Part 3 Preview 05:37

Understanding Pointer Basics - Part 4 Preview 09:55

Understanding Pointer Basics - Part 5 Preview 11:09

Understanding Pointer Basics - Part 6 Preview 07:34

PointerTest1

PointerTest2

Pointer Basics

This quiz will check your understanding on Pointers, please complete this entire section before attempting this Quiz.

Introduction to Array Preview 08:37

Introduction to Array, how array could be useful.

Input and output operations with 1 dimensional array. Preview 06:49

You will learn how to iterate through one dimensional array for input and output operations using simple for loop.


Array initialization Preview 04:47

Learn how you can initialize one dimensional array.

ArrayExercise1

ArrayExercise2

Relationship between 1D array and pointers. Preview 07:36

You must understand the relationship between the 1D array and pointers, in this lecture I will teach you in-depth about this. You will get to know how the subscription operator works to access an element for an array.

How to pass array to function. Preview 06:23

Learn how you should pass an array to function in this lecture.

Reverse an array: ArrayExercise 4

Passing array by reference to a function. Preview 04:49

This lecture will teach you how to pass an array by reference to a function.

Range for loop to traverse array. Preview 08:04

This new for looping style - range for is fantastic to traverse array.

Count above average numbers: Array Exercise 3

Count Values in range: ArrayExercise 4

Two dimensional array. Preview 09:58

Learn all you need to know about 2 dimensional array.

Introduction to String Preview 07:38

What is string and How we represent set of characters using string class in C++.

Different initialization options for string object. Preview 07:31

Learn how can you initialize string object using different constructor of string type.

StringTest1 : Declaration Initialization and some method

StringTest2:Accessing an element in a string

How to input string from keyboard using cin and getline Preview 04:40

Learn how you can input string from keyboard using cin and getline

String traversal using simple for loop and range for loop. Preview 08:53

This lecture will teach you how to traverse through a string using simple for loop as well as range for loop.

StringTest3: Printing each character of string separately

StringTest4: count number of vowels in string

String Iterator. Preview 10:58

You will get the concept of Iterator and how to use the iterator to traverse the string.

Credit Card number checking

Erasing a portion of string. Preview 05:20

Learn how to clear or erase a string or a portion of a string.

StringTest5: practice erase method

Some useful string methods. Preview 04:50

Learn some more useful string methods.

Find operation in String - how to search a target in string object. Preview 05:27

Learn how you can use the find operation to search within a string object/

find_first_of operation - Another useful string search method. Preview 06:54

This string method is useful to find first occurrence of target pattern. 

Comparing string with another string. Preview 03:43

This lecture will teach you how you can compare 2 strings lexicographically. 

replace method of string - useful when you need to replace a portion of string. Preview 05:36

This method replaces a portion of string with another target string, when used with find operation it gives the best result. Learn how to use this method.

StringTest: find and replace

The substring method to extract a portion of string. Preview 01:58

Learn how you can extract a portion of string object using this useful method.

istringstream - super utility. Preview 10:19

istringstream is considered as a super utility class in C++, if you need to parse/extract information from a string with different content then this class in the sstream header is a great tool. YOU MUST LEARN THIS.

Using istringstream

ostringstream - super utility Preview 04:16

Another great tool for C++ programmer to create string with different type of contents - YOU MUST LEARN THIS.

ostringstream test

Quiz on string

Test your skill on string of C++

Writing into a text file. Preview 10:08

Learn how to write text data into a text file from C++ program.

Writing to text file

Write some structured data into file

Reading from text file. Preview 07:14

This lecture will teach you how to read content of a text file in a C++ program.

File reading exercise 1

Part 1 - Reading and parsing structure data from text file Preview 08:39

This is the first part of 3 parts - here you will learn how to read and parse structured text data from a text file. The data file data2.tx is available in the zip.

Part 2 - Reading and parsing structure data from text file Preview 08:36

This is the second part. You can download the program and the data file attached in the first part (Part - 1)

Part 3 - Reading and parsing structure data from text file Preview 10:08

This is the 3rd and last part - you can download the data2.txt and the program attached with the first part (Part - 1)

Find BMI of teen agers

Part 1: Dynamic memory allocation. Preview 12:20

Concept of heap and stack area. How to use new keyword for allocating dynamic memory.

Part 2: Dynamic memory allocation - Why we need to deallocate, memory leak. Preview 08:34

Learn why we need to deallocate dynamic memory and the concept of memory leak.

Part 3: Dynamic memory allocation, Dangling Pointer. Preview 10:44

Learn what is dangling pointer and how you should take proper care not to have that in your program.

Quiz on Dynamic memory allocation

Test your acquired knowledge on Dynamic Memory Allocation.

Part 1: Introduction to vector. Preview 11:45

Learn why we need vector and how to declare and push elements into a vector object.

Part 2: Vector capacity vs size Preview 07:13

Learn the concept of vector capacity and the difference between the capacity and size of a vector.

Part 3: Vector constructor Preview 08:00

Learn how you can initialize a vector object with different constructors of the vector.

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. Preview 09:13

Learn some useful methods of vector class that you always need.

Get the iterator

Return reverse iterator for second last element of a vector.

Testing vector operations

Part 5: data method of vector Preview 05:30

Learn how the data is kept inside of a vector and the data method that returns the raw array kept inside the vector.

Quiz on vector

This quiz will test your knowledge on vector.

Part 1: Introduction to struct Preview 12:45

Why we need user defined type. How to declare struct type.

Part 2: How to write operations for struct objects, passing objects to function. Preview 09:47

Learn how to implement operations for struct type using global methods, how to pass struct object to method/function.

Part 3: Continuation of the previous lecture. Preview 08:29

Completing the program that we started in the previous tutorial. You can download the entire program attached in the previous tutorial.

Part 4: struct pointer Preview 09:40

Learn how to access struct object members using a pointer. The arrow operator.

Part 5: Array of struct objects. Preview 13:42

How to create array of struct objects and how to traverse the array to access each object kept in the array.

Part 6: Vector of struct objects. Preview 05:36

This lecture will teach you how to create a vector of struct objects, how you can push objects into a vector and how to access them.

Initialize structure object

Find the maximum distance

Quiz on Structure

Take this quiz to check your understanding with structure.

Part 1: Understand what we are going to develop. Preview 08:51

Introduction to the mini project, I will describe what the project is.

Part 2: Starting the project Preview 10:50

Let's start doing the mini project, I want you to download the data file attached and then follow me alongside doing this project.

Part 3: Mini project. Preview 09:37

This is the part 3 walk through of the mini project, you can download the entire program attached at the last part of this section.

Part 4: Mini project. Preview 07:27

This is the part 4 walk through of the mini project, you can download the entire program attached at the last part of this section.

Part 5: Mini project. Preview 12:44

This is the part 5 walk through of the mini project, you can download the entire program attached at the last part of this section.

Part 6: Mini project. Preview 21:55

This is the part 6 walk through of the mini project, you can download the entire program attached at the last part of this section.

Part 7: Mini project. Preview 09:43

This is the part 7 walk through of the mini project, you can download the entire program attached at the last part of this section.

Part 8: Mini Project. Preview 08:08

This is the final part of the mini project, you can down load the entire program attached.

Creating User Defined Types - Understanding the properties and behaviours. Preview 07:09

Basic understanding of User Defined types, why we need to create user defined types, the attributes and behaviours of type.

The class keyword - private and public members and their significance. Preview 11:13

Let us now start writing the Car class. Preview 08:46

Understanding Constructor method. Preview 10:29

Learn all about constructor method.

Let us complete the Car class. Preview 11:26

Here we complete writing the Car class. You can download the entire code attached in a zip file.

Recap - class, private, public, abstraction, objects, properties, behaviours. Preview 10:28

This lecture will help you to recap everything that you learned about classes and objects so far in this section.

this pointer - You must know about this. Preview 11:26

Constant mutable Preview 19:18

Inline function Preview 07:52

Inline functions are great for better performance. Learn all about inline functions with this lecture.

Using Code::Blocks writing class declaration and implementations separately. Preview 09:29

Here you will learn how to separate the class declaration and definition in 2 different files using Code::Blocks. You can download the entire Code::Block project attached.

Using Visual Studio separate class declaration and definition. Preview 11:06

Follow the steps to have the declaration and definition of a class separately  in Visual Studio.

Using Xcode on Mac to write declaration and definition in separate files. Preview 10:30

Using simple text editor and makefile Preview 17:09

Download, install make under windows. Preview 04:38

Write a class.

Write more methods for a class

Operator Overloading Introduction. Preview 07:01

Why we need to overload operator for our class.

Overloading arithmetic + and - operators. Preview 11:10

Learn how we can overload arithmetic plus and minus operator. The file attached contains all the overloaded operators that we will do in the next and subsequent lectures of this section.

Overloading unary increment (++) and unary decrement (--) operator. Preview 08:16

This lecture will show you how to overload the unary increment and decrement operators.

Overloading insertion << operator Preview 14:04

Understand how to overload insertion operator. You will get idea of friend function as well.

Overloading extraction >> operator. Preview 11:44

Understand how we should overload extraction operator and also how to do that as friend function.

Overloading relational operators. Preview 06:08

Overloading assignment operator. Preview 06:52

Learn how to overload assignment operator for a class and when we need to do that.

Copy constructor Preview 07:13

How we can write a vector of our own-idea of dynamic memory for instance member. Preview 07:17

Writing push_back method for our vector class. Preview 12:21

Overloading the subscription operator []. Preview 07:42

Overloading insertion operator for our vector. Preview 04:22

Writing destructor and why it is required this time. Preview 06:33

Part 1: Writing assignment operator and copy constructor Preview 10:24

Part 2: Writing assignment operator and copy constructor Preview 08:05

Function template. Preview 08:01

Class template Preview 06:11

Let us make the vector of previous section generic using template. Preview 08:47

In this tutorial you will experience how we can make the vector that we built in the last section generic using class template. 

Part 1: Inheritance - Basic concept Preview 08:07

Part 2: Understanding using a practical example. Preview 13:42

Part 3: Managing constructor in Inheritance - constructor redirection. Preview 10:26

Part 4: Super-type pointer and sub-type object - Dynamic polymorphism. Preview 11:47

Part 5: Dynamic Polymorphism in depth - how it helps. Preview 09:31

Part 6: Concept of pure virtual function. Preview 05:50

Part 7: Another example that uses pure virtual function and dynamic polymorphism Preview 11:04

Part 8: Concept of interface - a class with all abstract behaviours. Preview 11:33

Introduction to Exception Handling Preview 06:11

Understand what is exceptional situation and why we need to do proper management for handling runtime exceptional situation.

Handling exception using try catch block. Preview 10:48

Here you will learn how you can use try catch block to handle exception that may arise during execution of the program.

How to throw exception from function using throw keyword. Preview 11:49

Here in this lecture you will learn how you can throw exception from a method to report the exception to the caller method.

Writing more than one catch block to handle different types of exception. Preview 10:12

You will learn that we can write many catch blocks against a single try for handling different types of exception objects and also you will understand how to have a general catch block.

Writing custom exception class. Preview 10:38

Why and how we should write custom exception class for handling exception.

Introduction to Standard Template Library (STL) Preview 05:08

Basic Introduction to STL, learn what are the different components of STL.

STL Container Overview Preview 10:05

Learn about different categories of containers available in STL.

Common methods for all STL containers. Preview 09:03

Learn what are the common methods which are available for all the container across STL.

Common methods for Sequence Containers Preview 20:17

Learn and understand all the common methods for the sequence containers, means these are the methods which are available for any sequence container class.

Introduction to List - Sequential but discrete representation of elements Preview 06:39

Understand how the elements are represented in a list object. How it is different with vector.

Some important methods of list Preview 09:49

List iterators vs vector iterators Preview 11:45

Understand the difference between list iterator and vector iterator

emplace method - Create and insert object in one step Preview 08:54

emplace method can be used to create and insert objects into container. Learn how you can do that.

Understand function pointers. Preview 08:59

Function pointers in action - let's write program that uses function pointer Preview 14:53

Functors - Intro and why we prefer functors ober function pointers. Preview 17:33

Creating a base class for implementing functor Preview 05:03

Algorithm - count_if and functor Preview 06:00

Algorithm - remove_if and functor Preview 08:51

Algorithm - transform and functors Preview 07:46

Algorithm - more hands on examples on transform. Preview 08:14

Algorithm - for_each and functor with example. Preview 05:58

Introduction to Lambda - alternative to functor. Preview 10:31

Lambda - how to capture locals by value. Preview 09:07

Lambda - how to capture locals by reference. Preview 07:46

Binary functors - operator() that receives 2 parameters Preview 07:23

How to write a functor (and lambda) that receives 2 parameters.

Sorting elements of a container - sort algorithm Preview 10:59

Forward list - another sequence container. Preview 13:58

Learn about another sequence container forward list.

STL array class - a fixed sequence container. Preview 12:36

deque class Preview 12:34

STL stack class Preview 09:13

An overview of STL stack class.

Stack in Action - Let's develop a parentheses checker - Part 1 Preview 08:29

Stack in Action - Let's develop a parentheses checker - Part 2 Preview 10:05

The pair structure - useful utility. Preview 07:07

Associative container - Introduction to map. How to declare, insert and traverse Preview 14:41

Map - Part 2 continues, supplying custom comparator for ordering keys. Preview 05:55

Map - part 3: finding a key, deleting key Preview 08:06

Multimap - Introduction, declaration, insertion and traversal. Preview 07:54

Multimap - part 2: finding key using find and equal_range method, deleting. Preview 10:16

Multimap - part 3: how to update multimap entries. Preview 06:36

Unordered map - Part 1: Introduction, declaration, insertion, find, erase, usage Preview 10:42

Unordered map - Part 2: idea of hashing in unordered map, custom hash function. Preview 16:25

Referral Links for my other courses on Udemy. Preview 00:38