Privacy & Cookies
This site uses cookies. By continuing, you agree to their use. Learn more, including how to control cookies.
ARRAY Stores multiple items[Series of characters, multiple strings].
Array is declared in the form of;
int a[3][2]={
{1,4},
{5,2},
{6,5}
};
Declared array is of size 3*2.
This declared array contains total of 6 elements.
Row1: {1,4},
Row2: {5,2},
Row3: {6,5}.
Thus the array can be initialized row wise as well as sequentially.
Arrays are formulated as:
Type of array: Defines the type of element- Such as char, int , structure ec..
Name of array: Defines the name given to an array.
Number of element: Value inside the subscript[] gives the number of element.
Example:
char arr[5];
Initialization:
* Initializing each element seperately
Example:
int arr[10];
int i;
for [i=0;i