❔ Why it wont let me type array ?
Cant figure it out why im getting this, anyone can explain?
18 Replies
did jump the code using set next statement?
what does
test
contain there?shouldnt it contain strings typed out in it ?
are u in release mode?
the error is in
test[3] = "Zolas";
line
if ur in debug mode, that line should glow instead
anyway the array can only contain 3 elements
and u provided 4man i missed that, i suspected it tho
oh i tought 3 means = 4, yk 0,1,2,3
not when ur defining a size of the array
it works now thanks.
Been staring for good 10mins couldnt figure out error.
you created an array with 3 elements, the element numbers start from 0, that is, [0], [1], [2]. You created a non-existent index
Can i randomize array which is being typed? Like Console.WriteLine(test[Random index 1-3]); ?
Yes.
i tried this way but seems like im doing something not right xd
Google how to get a random number
Don't just guess
here is the correct solution
i did like this
still not sure what next means but il learn it in future.
Next is how you generate a number.
It's a method on the class Random
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.