Thanks, I simply did want -1 to show up as 1111111111... of width 10. which, in unsigned int, it would mean infinite (hence lots of ones...) but I just wanted to cut it at ten 1s.
I did not know sprintf always print the entire number. Thanks.
In reply to Re^2: Converting negative number to binary with specific width
by pjkang7
in thread Converting negative number to binary with specific width
by pjkang7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |