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, Receive 3 numbers and display them in ascending order from sma...

Receive 3 numbers and display them in ascending order from smallest to largest ed#

Software crisis, defining software crisis As the technology changes ra...

defining software crisis As the technology changes rapidly the requirement for the users' change, to part the growing demand of the user for trade,  business, and personal

What is inline function, Inline function: It is a function without prot...

Inline function: It is a function without prototype. The function is defined above main. The function should  be  declared  above  main  function.                  Declaring

Write a program that reads a line of characters, Write a program that reads...

Write a program that reads a line of characters from the user and displays that entire line after converting any uppercase characters to lowercase also change any lowercase charact

Write a program to define a matrix, Write a program to define a matrix: ...

Write a program to define a matrix: 1. Write a function that takes an integer and calculates and returns the factorial of the integer. The Factorial of a number "n" is compute

Text Editor, Add a function for saving the text stored in an array to a fil...

Add a function for saving the text stored in an array to a file. Your program must check whether or not the output file already exists, and if it does, your program must ask the us

Change to palindrome, a palindrome is a string that reads the same from bho...

a palindrome is a string that reads the same from bhote the ends

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