Yeah, but not in real code! I'd prefer it were readable over assigning one extra variable. You've got to find some specific conditions to make this the better code to use!
I actually used this in real code once, in an assembly inner loop where I was really running out of registers :), but you're right of course.
Related question: Did anyone here ever have to reverse a string? :D
Not in an interview, but in a quiz somewhere. It was an entry level one so only restriction was to not use the built in functions.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah, but not in real code! I'd prefer it were readable over assigning one extra variable. You've got to find some specific conditions to make this the better code to use!
I actually used this in real code once, in an assembly inner loop where I was really running out of registers :), but you're right of course.
Related question: Did anyone here ever have to reverse a string? :D
Not in an interview, but in a quiz somewhere. It was an entry level one so only restriction was to not use the built in functions.