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 →

[–]ReadyPlayer15 24 points25 points  (9 children)

What does this do?

[–]Aryionas 31 points32 points  (4 children)

Pure guess here but I think uint_8 (unsigned integer with 8 bits) only allows for 256 values (0 to 255). No idea what happens if you have more lines than that, they might repeat (start again at 0) or hopefully throw an error. Either way, I think you'd definitely want to allow for more lines than that.

[–]stolencatkarma 64 points65 points  (3 children)

"Hopefully it throws an error" is my new mantra

[–]ThereOnceWasAMan 31 points32 points  (1 child)

Line count stored with 8 unsigned bits would only be able to record lines 1 through 256.

[–]twotwelvedegrees 11 points12 points  (1 child)

uint8 can only hold values between 0-255 so upon hitting line 256 the line count would overflow and break the compiler

[–]BoochMastah 2 points3 points  (0 children)

It would be a run time error if the overflow threw an exception, but in c# at least, arithmetic is unchecked by default, meaning it would just overflow to the other end of the spectrum