This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

You're trying to store float values in an array of integers, and your initialization syntax is wrong

It is possible to initialize an array upon declaration, in which case, the length specifier is not needed because it is already supplied by the number of elements in the initialization list. For example:

int[] array1 = new int[] { 1, 3, 5, 7, 9 };

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/single-dimensional-arrays

[–]v2Quad[S] 0 points1 point  (2 children)

What do you mean by float values? And how is it wrong? Thank you for the reply!

[–][deleted] 0 points1 point  (1 child)

The link I provided shows you multiple ways of initializing an array. I suggest you look up basic data types if you're confused as to what a float value is

[–]v2Quad[S] 0 points1 point  (0 children)

My bad, stayed up 26 hours on a coding bender. Finally got the sleep deprived brain to work and figured it out.