Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

thank you for sharing this post. :)

can somebody give an example for the line:

  int len = slen;      // Here if slen is too big, it loops backs to 0
what happens if slen is to big? all bits in len are zero? (sorry for this noob question btw, just started with c programming) :)


Yes. Imagine you have a 2-bit integer. `11 + 1` in binary is `100`. The last `1` does not fit so only the remaining `00` gets included. The same applies for any N-bit integer.


thank you - got it this way! :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: