C++ Array

An array is a set of consecutive memory locations used to store data.
  • Each item in the array is called an element.
  • The number of elements in an array is called the dimension of the array.

Syntax :
datatype array_name[size_of_array];
Example :

//char is datatype, name is "array name", 25 is size of array
char name[25];
int student[50];
float percentage[50];

Student stud[100];
// Don't panic. Student is user defined datatype
// We will learn about user-defined datatype in further sections.

0 Comments