SmartPointer that Iterates through a Container

Understand the implementation of a user-defined "SmartPointer" class that iterates through a linked list container.

We'll cover the following

Problem

Write a program that maintains a linked list using a Container class. Also, implement a SmartPointer class that lets you access Container elements using the * operator and lets you iterate through the Container using the ++ operator.

Sample run

Here’s what you should see when you run the program.

10
20
0
-40
50

Coding solution

Here is a solution to the problem above.

Get hands-on with 1400+ tech skills courses.