you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 3 years ago (1 child)

Not that I'm aware of but that's a condition where you're thinking with an index. What's the difference you're looking for?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 years ago (1 child)

    Something like parsing a string that could have command codes in it of varying length. So I guess the difference is, is this a 1-, 2-, or 3-character code?

    I have something like this in a barcode generator and I keep trying to find a way to make it more elegant, but I keep coming back to index and offset as the simplest and most understandable approach.

  • source
  • parent
  • hideshow 2 child comments