c# define array
float[] floats = new float[]{1.0,1.1,1.4,1.23,2212.233};
c# define array
float[] floats = new float[]{1.0,1.1,1.4,1.23,2212.233};
array declaration in c#
// Syntax: data_type[] variable_name = new data_type[size];
// Decalring array of integers of length 5
int[] intArr = new int[5];
// Declaring array of strings of length 5
string[] names = new string[5];
// We can also populate the array, if we know the elements in advance
int[] evenDigits = new int[] {0,2,4,6,8}; // notice that in this, we don't need explicit size declaration.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us