C
C#2mo ago
LordoToasty

System.ArgumentOutOfRangeException: Pls Help :.)

I got an assignment to do a conversion between ascii and base64 but not the easy way (cus that's just 6 steps) but with as much self-writen code as possible, but I think I can't get it to wotk cus of an error occurring over and over again.
5 Replies
Buddy
Buddy2mo ago
Did you press step into when debugging?
LordoToasty
LordoToasty2mo ago
I just set a breakpoint and then click F11 (singlestep)
Buddy
Buddy2mo ago
It just means your index is out of range. Meaning if there are 2 elements in a list. index 0 points to the first element and index 1 points to the second. However, if you go outside of that it will throw an exception like you have now
LordoToasty
LordoToasty2mo ago
"currentcase |= BoolToByte(pre64_bits[(i * 6) + j]);" It's this line that causes the problem and I know what OutOfRangeException in general means, but I don't get where my math sucked hard enough to throw that exception.
canton7
canton72mo ago
If you debug down to that line, you can hover over the variables to see what their values are, and hover over the * and + to see what those parts of the expression evaluate to
Want results from more Discord servers?
Add your server
More Posts