Write about Multi Dimensional Arrays?

C allows arrays of 3 or more dimensions. The exact limit is determined by the compiler. The general form of a Multi Dimensional Arrays is:

Type arrayname [s1][s2][s3]……….[sn];

Where Si is the size of the i th dimension.

Ex : int survey [3][5][12];

        float table [5][4][5][3];

Survey is a 3-Dimensional  array declared to contains 180 integer type elements similarly table is a 4-Dimensional  array contain 300 elements of floating point type.

The array survey may represent a survey data of rainfall during the last 3 years from January to December in 5 cities.

If the first index denotes year, the second city and the third month, then the element

survey [2][3][10];

Denotes the rainfall in the month of October during the second year in city -3.

Remember that a three-Dimensional  array can be represented as a series of two Dimensional arrays of shown below.

multidimensional arrays


ANSI c does not specify array limit for array di however, most compiler per 7 to 10 dis. Some allow even more. 

Related

Write about Dynamic Arrays?

An arrays created at compile time by specifying size in the source code was a fixed size and cannot be modified at ran time. The process of allocating memory at compile time is kn...

Write about Operators in ‘C' Language?

C supports a rich set of built-in operators. Operator: operator is a symbol that tells the computer to perform certain mathematical (or) logical manipulations. Operators are used i...

What is an Arithmetic Expression? Write the procedure for evaluating an Arithmetic Expression?

An arithmetic expression is a combination of variables constants , and operators arranged as per the syntax of the language . C can handle any complex mathematical expressions. Ex:–   x...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item