Multidimensional array: Multidimensional arrays can be described as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements, all of them of a same uniform data type.
int arr[3][5]; represents a bidimensional array of 3 per 5 elements of type int.
Similarly a three dimensional array like int arr[3][4][2]; represent an outer array of three elements , each of which is a two dimensional array of four rows, each of which is a one dimensional array of five elements.
Multidimensional arrays are not limited to two or three indices (i.e., two dimensional or three dimensional). They can contain as many indices as needed. However the amount of memory needed for an array rapidly increases with each dimension. For example:
char arr [100][365][24][60][60];declaration would consume more than 3 gigabytes of memory.
Memory does not contain rows and columns, so whether it is a one dimensional array or two dimensional arrays, the array elements are stored linearly in one continuous chain. For example, the multidimensional array is stored in memory just like an onedimensional array shown below:
int arr[3][4][2]= {
Multidimensional arrays are just an abstraction for programmers, since we can obtain the same results with a simple array just by putting a factor between its indices.
printf("how namy names u want to enter");
scanf("%d",&n);
printf("enter names :\n");
for(i=0;i<n;i++)
scanf("%s",a[i]);
for(i=0;i<=n-2;i++)
{
for(j=0;j<n-i-1;j++)
{
if(cmp(a[j],a[j+1])>0)
{
cpy(b,a[j]);
cpy(a[j],a[j+1]);
cpy(a[j+1],b);
}
}
}
}