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

C program for function of count the characters in each word, C Program for ...

C Program for FUNCTION OF COUNT THE CHARACTERS IN EACH WORD void count(char c[]); void main() {           char a[50];           int i=0;           clrscr();

Oop, evolutio of object oriented programing

evolutio of object oriented programing

What are all of the implicit member functions of the class? , What are all ...

What are all of the implicit member functions of the class? Or what are all of the functions that compiler implements for us if we don't describe one? A: 1.      copy ctor

Explain call by reference, Call by Reference Passing variables(paramete...

Call by Reference Passing variables(parameters) to a function in C can be done in two ways - pass by value, also called as call by value and pass by address or also known as ca

Implementing functions, An employee’s total weekly pay equals the hourly wa...

An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied

What is the best fit algorithm, The Best fit algorithm: The best fit metho...

The Best fit algorithm: The best fit method occurs the smallest free block whose size is greater than or equivalent to n. An algorithm to get such a block by traversing the whole

Explain constructors, Constructors By definition, a constructor functio...

Constructors By definition, a constructor function of some class is a member function that automatically gets implemented whenever an instance of the class to which the constru

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Arrays, what is an array?

what is an array?

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