Explain the declaration of multi dimensional arrays, C/C++ Programming

Assignment Help:

Explain the Declaration of Multi Dimensional Arrays?

In the figure, the range in the first dimension is 3 and in the second dimension is 4. The shaded portion corresponds to the element a [2][2]. While initializing a 2D array, it is necessary to mention the second dimension (example. column) whereas the first dimension is optional.

772_Multi Dimensional Arrays.png

Therefore in the declarations shown below: - 'a' and 'b' are right whereas 'c' is wrong

a. static in a[3][3]={
{0,1,2},
{3,4,5},
{6,7,8}
};
b. static int a2 [][3] = {10,4,9,8,2.3} ;
c. static int a3 [][] = {10,4,9,8};]'
d. static int al [2][2] = {10,4,9,8} ;

A multidimensional array is as well possible. For illustration a 3-D array can be written as int a [3][2][2]. For identify an element of this array 3 subscripts will be needed for example a[m][n][p]. The first subscript specifies a plane number and the next two specifies the column and the row. The three-dimensional array is an array containing spatial information, which is able to be indexed by latitude, longitude and altitude.

For specifying an element of an n subscripts, n dimensional array are needed sometimes the geometric analogy breaks whenever go beyond 3-D. Still C programming language permits arbitrary number of dimension.


Related Discussions:- Explain the declaration of multi dimensional arrays

Padovan string, padovan string program in java // aakash , suraj , p...

padovan string program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class PadovanString {     publ

Hw8, Asks the user for an integer. if the number is less than 21, ask them ...

Asks the user for an integer. if the number is less than 21, ask them for a number again; repeat this until you get a number bigger than 20. 20 is not an acceptable number. Once yo

What are source files and bytecode files, Problem : (a) What do you u...

Problem : (a) What do you understand by the term ‘constructor' in Java? Explain with an appropriate example. (b) Describe the differences between an object and a class usi

Built a web crawler , To develop a web crawler such that when given a base ...

To develop a web crawler such that when given a base URL, it will traverse the entire web tree and then build an index of keywords and what URL link they appear on.   The web crawl

Prepare a script for providing instagram followers, Prepare a script for pr...

Prepare a script for providing Instagram Followers/Likes I need to prepare a panel where my customer able to get Instagram followers or likes automatically. - A panel where I

Left in the lurch, Hey vrcoder I have got similar way but the game builder ...

Hey vrcoder I have got similar way but the game builder has sent me the game unfinished and left. I saw it on a link on line but they have wiped the old message with the link in it

Calculating interest, The interest charged on a loan banking facility is ca...

The interest charged on a loan banking facility is calculated based on principal amount, rate and time. implement a C program that can be used to automate the calculation of the in

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd