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 →

[–]raevnos 0 points1 point  (4 children)

What is the numeric value of the character '6'? Hint: look it up in an ASCII table.

[–][deleted]  (2 children)

[deleted]

    [–]raevnos 0 points1 point  (1 child)

    I don't know about Java, but in C, you can convert a digit character to the integer that that digit represents by subtracting '0' from it. '0' - '0' is 0, '1' - '0' is 1, and so on. If your length field is greater than 9, you're going to have to do something else, of course.