Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

what is array?

+1 vote
asked Feb 7, 2020 by labintumbapo (160 points)

1 Answer

0 votes
answered Feb 12, 2020 by gameforcer (2,990 points)

From a technical point of view:

It is a block of memory that allocates N elements of the same byte size.

Less technical:

It is a set of elements that you can access by single name and some iteration, C++ example:

int arr[3] = {1,2,3};

std::cout<<arr[0];

Here array's name is "arr" and each element is accessed by adding square brackets to it's name with element's position number (index) inside them.

In most languages array indexes start from zero, therefore in this example it will print out first element of array, which has value of 1.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...