C/C++ Pointers & Applications
4.1 (97 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
932 students enrolled

C/C++ Pointers & Applications

Learn the applications of pointers such as usage in dynamic arrays, linked lists, function pointers, callbacks, etc
4.1 (97 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
932 students enrolled
Created by Umar Lone
Last updated 4/2020
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 7 hours on-demand video
  • 9 articles
  • 11 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Understand in depth how pointers work
  • Understand the applications of pointers
  • Understand efficient implementation of basic data structures
  • Understand how callback mechanism works through pointers and objects
Course content
Expand all 80 lectures 06:52:51
+ Introduction
5 lectures 20:00

Introduction of the course.

Preview 01:40

Source Code for modern C++ lecture & introduction to pointers.

Source Code

This lecture covers some basic features of Modern C++ (C++11/14). These features are used extensively in the subsequent lectures and make it easier to write code and make it more expressive.

Preview 07:34

Learn about the basics of pointers, stack, heap and data section.

Introduction to Pointers

This lecture will show an example of using pointers. We'll examine them using the memory window of Visual Studio.

Examples of Pointers
+ Static Arrays
9 lectures 43:38

Source code for arrays section

Source Code

Introduces static arrays (arrays that are created on stack, at compile time)

Array Basics

This lecture demonstrates usage of arrays and their representation in the memory.

Examples of Static Arrays

Demonstrates how arrays can be passed as arguments into functions.

Array as Function Argument

Demonstrates how arrays can be passed by reference into functions through templates.

Preview 06:15

A gentle introduction to standard library std::array.

Introduction to std::array<T>

Learn how to create dynamic arrays on heap through new operator. You'll also see how dynamic arrays are represented in the memory.

Heap-based Arrays

This video discussed multi-dimensional static arrays and their syntax along with pointers to such arrays. You'll also learn how to pass multi-dimensional arrays to functions.

Multidimensional Arrays

Here, you'll learn how to create multi-dimensional arrays on heap using new and how they are represented in heap memory. 

Multidimensional Arrays on Heap
+ Dynamic Arrays
19 lectures 01:55:11

Provides the code for the dynamic array and the Noisy class. This class is used for debugging in dynamic arrays.
Note: Noisy class is provided for two different standards. If you're compiling your code with C++17 standard, include noisy_cpp_17.h. Otherwise, use both noisy_cpp_old.h & noisy_cpp_old.cpp.

To enable tracing with old noisy class, you've to define _DOTRACE macro in noisy_cpp_old.h header.

Source Code

Revisits dynamic arrays on heap and discusses their advantages in comparison with static arrays. This lecture also explains the Dynamic Array project along with the important functions.


In this part, we'll implement different kinds of constructors in the dynamic array class.


Here, we'll add accessor functions (back, front, getat, etc).


This lecture explains implementation of important functions such as Add & Insert.


Here, we'll discuss how to implement the erase functionality in the dynamic array.

Element Erasure

This is the start of four-part discussion on move semantics. Move semantics is a very important part of C++11 as it greatly improves the performance of the code. 

This part prepares the groundwork by explaining the basics of rvalue and lvalue references.

Copy/Move Semantics - Part I

The second part demonstrates different function overloads based on value types.

Copy/Move Semantics - Part II

Here, we'll discuss how copy semantics work.

Copy/Move Semantics - Part III

In this part, you'll learn how to implement move constructor and assignment in the Integer class. You'll also understand when move semantics are used by the compiler for objects of the class. We'll also learn about the library function, std::move

Copy/Move Semantics - Part IV

In this lecture, we'll implement move and copy semantics in the dynamic array class and understand how this improves the performance of our code.

Copy/Move Semantics Implementation

The dynamic array class has several issues due to usage of new[] operator. This video explains all these issues in depth.

Preview 04:59

Placement new is a very powerful operator for creating an object without allocating memory. Using this operator, this lecture demonstrates how it can help us overcome the issues in the dynamic array class.

Placement new & delete

This lecture builds explains and demonstrates how the placement new operator can be used to dynamically & efficiently grow a heap-based array.

Preview 03:15

We'll create a new dynamic array in this video and implement smart reallocation technique in it. We'll start by implementing constructors and a destructor.

New Dynamic Array I - Constructors

Here, we'll implement the Add function in the new dynamic array class.

New Dynamic Array II - Add Function

Discusses implementation of the Insert function.

New Dynamic Array III - Insert Function

We'll add some more functions in the array class and also fix some bugs.

New Dynamic Array IV - Miscellaneous Functions

This lecture revisits the pros and cons of arrays - both static and dynamic. It also proposes an alternative data structure called list, which we shall discuss in the next section.

Arrays - Conclusion
+ Singly Linked Lists
10 lectures 49:11

Source code for singly-linked list.

Source Code

This lecture explains the basics of linked lists. You'll learn how pointers are used to create nodes which ultimately form a chain, called linked list.

Linked Lists Introduction

We'll add the common functions in the list class, but implement them in subsequent videos.

Basic Functions

We'll implement the Add function in this lecture.

Modifiers - AddFront & AddBack

In this video, we'll implement various constructors in the list.


In this video, we'll implement move and copy semantics in the list.

Copy/Move Semantics

You'll learn how to insert a new element in the list, by creating a node and inserting at the correct position in the list.

Modifiers - Insertion

You'll learn how to remove elements by erasing nodes from the list without breaking the chain of nodes.

Modifiers - Erase

To access the elements of the list, we expose the head pointer to the users. This is a violation of encapsulation and you'll learn how to prevent this. 


We'll further encapsulate the List class. We'll also add support for element access without exposing the node pointers.

Element Access
+ Doubly Linked Lists
9 lectures 46:02

Source code for doubly-linked list

Source Code

You'll understand the basic structure of a doubly linked list. We'll start adding common functions in a list class.

Basic Functions I

In this video, we'll implement a few accessor functions (Front, Back).

Basic Functions II

You'll learn how nodes are added to doubly linked list at the front and back.

Modifiers - Add

In this video, we'll implement support for element access through the Position context class.


We'll complete the implementation of the constructors.


In this video, we'll implement the functions to remove elements at the front and back of the list.

Modifiers - Front & End Removal

Here, you'll learn how new nodes can be inserted in the list by implementing the Insert function.

Modifiers - Insertion

In this video, we'll implement the erase function and learn how to remove nodes from the list at any position.

Modifiers - Erase
+ Strings
6 lectures 35:21

Source code for Strings section.

Source Code

Introduces the basic concepts of strings and how they're represented as arrays.


Shows the implementation of calculating the length of the string.

String Length

Shows the implementation of copying and joining/concatenating strings.

Copy & Join

Shows how to create a duplicate of a string through dynamic memory allocation.

Copy through Allocation

We'll put together the concepts learnt in the earlier videos of string and create a string class. This class will manage the memory allocation/deallocation automatically.

String Class
+ Function Pointers
8 lectures 40:18

Source code for function pointers.

Source Code

This lecture introduces the concept of function pointers. 

Basics I

Demonstrates function pointers with more examples.

Basics II

Here, you'l learn how to pass function pointers as arguments to functions

Function Pointers As Arguments

This lecture explains how function pointers can be returned from functions as values.

Function Pointers As Return Values - I

More examples of function pointers as return values.

Function Pointers As Return Values - II

You'll learn how to create array of function pointers.

Arrays Of Function Pointers - I

Shows how to return an array of function pointers from a function. You'll also learn how to create a dynamic array of function pointers on heap.

Arrays Of Function Pointers - II
+ Pointer To Member
5 lectures 15:57

Source code for Pointer to member section.

Source Code

Introduces the syntax of creating pointer to a members of a class.

Basic Syntax

Explains how to create a pointer to a constant members of a class.

Constant Member Functions

Here, you'll learn how to simplify the syntax of using pointer to members.

Simplifying Through Macros

This lecture explains how to create pointers to static members of a class.

Static Members
+ Callbacks
9 lectures 47:09

Source code for Callbacks section.

Source Code

In this lecture, we'll discuss an example of a Find algorithm that will serve as the foundation for learning callback concept later.


Here, you'll learn how function pointers can be used as callbacks.

Function Pointers As Callbacks

We'll see another example of function pointers as callbacks in this video.

Function Pointers Example

This lecture demonstrates usage of member functions as callbacks through templates.

Member Function As Callback

This video explains the basics of function objects.

Function Objects

In this lecture, you'll learn and understand how function objects are used as callbacks instead of function pointers.

Function Objects As Callbacks

We'll go deep into the internals of how the compiler invokes a function pointer and a function objects. Consequently, you'll come to appreciate the advantages of using function objects as callbacks.

Function Object Internals

You'll learn the key differences between function pointers and function objects as callbacks. You'll also learn how to choose between the two when you want to use a callback.

Function Objects Vs Function Pointers
  • Basic knowledge of C & C++
  • Should understand basic syntax of pointers

C & C++ are very powerful languages when it comes to performance & flexibility. But there are some features that are complex and take time to master. One of such features is pointers. Pointers is what separates C/C++ from other languages. These are incredibly powerful as they allow programs to access memory directly and manipulate it.

This course focuses on pointers and their applications.It leans more towards implementation in C++, rather C. You'll learn the basics of pointers and then move on to understanding and implementing arrays, pointers to arrays & heap based arrays. You'll also learn advanced memory management by creating a custom dynamic array (just like std::vector<T> in standard C++ library). You'll use placement new & delete to directly place objects in a memory pool allocated through operator new function. As you'll see later in the course, this is a powerful mechanism to optimize usage of heap memory with user-defined objects.

After arrays, you'll learn how to use pointers to create node-based data structures. We'll focus on two types of linked lists - singly & doubly linked lists. You'll understand the difference between arrays and lists and also learn how to access the elements of both the data structures without having to know their internal structure. This is possible by creating context variables that allows access in a container-agnostic manner. 

Pointers are invaluable while working with strings. You'll learn how to create dynamic strings using pointers. This will be shown with an implementation of a string class.

The next important topic you'll learn and implement will be function pointers. You'll understand how function pointers work and how we can simplify their syntax. You'll also master the complexity of creating arrays of function pointers and functions that return function pointers. On top of that, you'll be comfortable with functions returning pointer to functions that themselves return pointer to other functions. Confused? See the section on function pointers.

That's not all. You'll also learn how to create pointer to members (which have even a more complex syntax than function pointers). 

Furthermore, you'll learn how to create callbacks through functions pointers. This course will show you how to optimize the callbacks through function objects. Function objects are more powerful than functions pointers as callbacks.We'll use this knowledge and apply it in many examples to reinforce the concept of pointers to functions.

This course also introduces some commonly used containers of the C++ standard template library (STL), such as std::array, std::vector & std::list. By the time you hit these topics, you'll already know how these are implemented internally. How about that!

This course relies on some modern C++ (C++11) features to simplify things, such as auto, std::initializer_lists, type aliases. Even if you don't know about these features, the course has videos on these topics to get you started. Additionally, there are four full length videos dedicated to discussion on move semantics.

I hope you enjoy this course!

Who this course is for:
  • Anyone who wants to increase their proficiency in C/C++ pointers
  • Anyone who wants to learn the applications of pointers
  • Anyone who wants to understand how basic data structures work internally