Templated Array Class

Learn about the creation of templated Array classes in the C++ language.

We'll cover the following

Problem

Write a program that implements an Array class using templates. Use the Array class to maintain an array of integers and an array of floats.

Sample run

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

0       0.5
1       1.5
2       2.5
3       3.5
4       4.5
5       5.5
6       6.5
7       7.5
8       8.5
9       9.5
Lengths = 10    10
Lengths = 0     0

Coding solution

Here is a solution to the problem above.

Get hands-on with 1400+ tech skills courses.