One-dimensional array (1-D arrays)
You can imagine a 1d array as a row, where elements are stored one after another.
Syntax for Declaration of Single Dimensional Array
Below is the syntax to declare the single-dimensional array
data_type array_name[array_size];
where,
- data_type: is a type of data of each array block.
- array_name: is the name of the array using which we can refer to it.
- array_size: is the number of blocks of memory array going to have.
For Example
int nums[5];
Types of Arrays
There are majorly three types of arrays
Contact Us