❔ help with error
so basicaly i have this really complex assignment for no reason and i made this code and im in the part where i have to place it back into the orignal array but im getting an error of outofbounds and i see that the variable count becomes 15 but idk how because it should be 5 in this case because the array initalized made 5 rand numbers
7 Replies
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
Well, the count variable is incremented inside of the nested loop, so it will always be equal to row*col
As a side note, you can reuse a single instance of random, no need to create so many
ok well i kinda fixed that up
still having the porblem tho with teh loop
when it goes from 1 to 6
it gives that error
i think its because for some reason its taking the first index of the next iteration and putting it with the previous one
so thats increasing teh count too much
but idk how tof ix that
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.