Let's talk about Array

Arrays  is a kind of data structure that can store a fixed size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.

Instead of declaring a variable of same type again and again you can simply create a array of that type for example int,char,etc.You can declare a one array of any of these type and use a[0],a[1].....to represent individual elements.

We can declare a array as,

datatype array_name[array_size];


We can also initialize array in c/c++ either one by one or using single statement.


  

Comments