answersLogoWhite

0

A one-dimensional array is simply a series of values.

int a[10]; // A series of 10 integers.

Multi-dimensional arrays are the same, there's just more series involved. A two-dimensional array is simply a series of one-dimensional arrays.

int b[10][10]; // 10 elements of 10 integers each.

A two-dimensional array is easiest to imagine as a chessboard or a sudoku grid or graph paper, with width and depth:

int sudoku[9][9]; // A 9*9 grid.

Elements of a 2 dimensional array are accessed by rank and file, or column and row, or X and Y coordinates, whichever is appropriate.

int x = sudoku[3][5]; // Access the value at row 3, column 5.

2 dimensional arrays needn't be square, they can be rectangular:

int y = rectangle[5][10]; // Array of 5 elements with 10 values each.

A three-dimensional array is akin to a cuboid, or multiple chessboards stacked on top of each other. Each "cell" is accessed 3 dimensionally, via width, depth and height, or X, Y and Z coordinates.

int cuboid[100][20][10;

int X=4,Y=5,Z=7;

int f=cuboid[X][Y][Z];

A four-dimensional array is very much like a one-dimensional array, except each element is now a three-dimensional cuboid. Five dimensions is like a chessboard, where each square is now cuboid, and 6 dimensions is a cuboid where each cell is a cuboid. And so on. A case of divide and subdivide.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is single dimensional array in c plus plus?

A one dimensional array is an array of objects that goes in one "direction". Any array with only one [] is a one dimensional array. For example: int numbers[6]; is a one dimensional array. int numbers[6][3]; is a two dimensional array.Graphical terms:One dimensional array[4]:14 - 75 - 8164 - 234Two dimensional array[2][3]:47 - 178108 - 8517 - 128It didn't come out quite how I wanted it...


How do you initialise a two dimentional array?

C provides rectangular multidimensional arrays. In C, a two-dimensional array is really a one-dimensional array, each of whose elements is an array. An array is initialized by a list of initializations in braces; each row of a two-dimensional array is initialized by a corresponding sub-list. Example of two dimensional array initialization: char array_example[2][4] = { {11, 12, 13, 14}, {21, 22, 23, 24} };


Columns and rows in c programming?

Do you perhaps mean -- a two-dimensional array? A two dimensional array is nothing more than a one-dimensional array where every element is a one-dimensional array. int matrix[4][5]; C is a row-major language thus the first dimension refers to the number of rows. Here we have declared an array of 4 rows, where each row is an array of 5 elements of type int.


How you create table in c language?

The simplest way to create a table in C is to use a two-dimensional array.


How many types of arrays in c?

An array is simply a contiguous block of memory containing two or more elements. There are two types of array: a static array which is allocated on the stack at compile time; and a dynamic array which is allocated on the heap at runtime. Both can be one-dimensional or multi-dimensional. A one-dimensional array can be likened to a row (or column) of chessboard squares, with as many squares as required to store all the elements. A multi-dimensional array is any array with two or more dimensions. A two-dimensional array can be likened to the whole chessboard, where any square can be identified by its row and column index. However the dimensions needn't be equal. A two-dimensional array can also be imagined as a one-dimensional array where every element is simply another one-dimensional array. Three-dimensional arrays can be likened to a cube, or as a one-dimensional array of two-dimensional arrays. A four-dimensional array can be linked to a one-dimensional array of three-dimensional arrays, and so on. Although every one-dimensional array must be allocated in contiguous memory, multi-dimensional arrays can be dynamically allocated so that each dimension is itself a separately allocated one-dimensional array of pointers to the next dimension, making it possible to allocate extremely large arrays over a series of smaller allocations rather than as a single contiguous block.


What is the lowest subscript of an array in c plus plus?

The lowest subscript of an array in C, or C++ is 0.


How do you write a program in c plus plus to check if an array is symmetric?

To determine if an array is symmetric, the array must be square. If so, check each element against its transpose. If all elements are equal, the array is symmetric.For a two-dimensional array (a matrix) of order n, the following code will determine if it is symmetric or not:templatebool symmetric(const std::array& matrix){for (size_t r=0 ; r


Making multiplication table in c plus plus using do while loop?

Um, not sure how to do that, but you can create a sort of "table" in C++ by using multidimensional arrays. Below is an example of how to create a two-dimensional array: int myArray[10] [10]; You can add more dimensions to the array in order to increase its storage capacity.


A c plus plus code to make a multidimensional array that can store strings?

int myarray=[5][5]; This snippet of code creates a 5X5 two-dimensional array. You can declare an array with more dimensions, but you shouldn't really need to go above more than four dimensions. Four-dimensional arrays are only used by high-end graphics programs or programs that need to calculate a ton of data.


Program to display multiplication of two matrix?

The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.


Is two dimensional array is multi dimensional array in c language?

Yes because multi means more than one in programming, just like it does in English. No isn't that a surprise. Have you read any good programming text books lately.


Give the syntax to declare two dimensional array using array of pointers?

It is not possible to declare a two-dimensional array using an array of pointers in any programming language, but many programming languages support declarations of N-dimensional arrays of pointers.The exact syntax varies with the programming language, and requires support for N-dimensional arrays and pointers. In C, the following declares an array of pointer variables, each implemented as pointer to the generic type "void":void* array_1D[10];The type of the expression array_1D is "void * const."The following example expands on the previous one by declaring a two-dimensional array of "void" pointers:void* array_2D[10][20];The type of the expression array_2D is "void ** const."The last example declares a 3-dimensional array of "void" pointers, which can be seen as a 2-dimensional array of arrays of pointers:void* array_3D[10][20][30];