What are the different data types of arrays in C#?


With C#, you can create an array of integers, chars, etc. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type stored at contiguous memory locations. This type can be integer, char, float, etc.

The following is an array declaration showing the datatype usage −

datatype[] Name_of_array;

Here,

datatype is used to specify the type of elements in the array.

[ ] specifies the rank of the array. The rank specifies the size of the array.

Name_of_array − specifies the name of the array.

Set the integer array −

int[] a;

Set the double array −

double[] z;

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 20-Jun-2020

415 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements