Creating an Array

Introduction

An array is a collection of elements of the same data type a the single name. Let’s see how we can declare and initialize an array in C++.

Array declaration

The general syntax for declaring an array is given below:

Get hands-on with 1400+ tech skills courses.