Explain multidimensional arrays, C/C++ Programming

Assignment Help:

Multidimensional Arrays

- Every dimension is specified in separate brackets

e.g.

int arr[4][3];

This is a two-dimensional array with 4 as row dimension and 3 as a column dimension.

- Multidimensional array can be initialized as follows

e.g.

int arr[4][3] = {{0,1,2},{3,4,5},{6,7,8},{9,10,11}};

  • The nested brackets are optional.

e.g.

int arr[4][3] = { 0,1,2,3,4,5,6,7,8,9,10,11};

int arr[4][3] = {{0},{1},{2},{3}}; // First element of

    rows are 0,1,2,3 and remaining are considered zero.

int arr[4][3] = {1,2,3}; // Initializes first three element of first row as 1,2,3, and remaining elements are considered Zero.

 


Related Discussions:- Explain multidimensional arrays

Program is to find the maximum from two numbers, Program is to find the max...

Program is to find the maximum from two numbers: Program is to find the maximum from two numbers entered by the user having pointer variable as parameter void main()   {

Implementation of the definition class - c++ program, Implementation of the...

Implementation of the Definition class: void Definition::put_word(char *s) {    word = new char[strlen(s)+1];    strcpy(word,s);    nmeanings = 0; }   voi

Employee salary, wap to read an employee salary and calculate DA,HRA,pf,GRO...

wap to read an employee salary and calculate DA,HRA,pf,GROSS,NET conditions:- BASIC DA HRA PF >10000 7% 9% 10% & >20000 9% 11% 15% &

Function, give an example of function

give an example of function

Pebble merchant, There is a pebble merchant. He sells the pebbles, that are...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

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