- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Size of a Three-dimensional array in C#
To get the size of a 3D array in C#, use the GetLength() method with parameter as the index of the dimensions.
GetLength(dimensionIndex)
To get the size.
arr.GetLength(0) arr.GetLength(1) arr.GetLength(2)
Example
using System; class Program { static void Main() { int[,,] arr = new int[3,4,5]; // length of a dimension Console.WriteLine(arr.GetLength(0)); Console.WriteLine(arr.GetLength(1)); Console.WriteLine(arr.GetLength(2)); // length Console.WriteLine(arr.Length); } }
Output
3 4 5 60
- Related Articles
- Get rank of a three-dimensional array in C#
- Get bounds of a C# three-dimensional array
- Get Upperbound and Lowerbound of a three-dimensional array in C#
- Get the width and height of a three-dimensional array
- Return a new Three-Dimensional array without initializing entries in Numpy
- How to find the mean of three-dimensional array in R?
- Dimensional Array in C#?
- 4 Dimensional Array in C/C++
- How to declare a two-dimensional array in C#
- What is a one-dimensional array in C language?
- What is a two-dimensional array in C language?
- What is a multi-dimensional array in C language?
- Return a new Three-Dimensional array without initializing entries and change the order in Numpy
- Passing two dimensional array to a C++ function
- How do I sort a two-dimensional array in C#

Advertisements