http://ideone.com/UPjm6 The information printed to stderr by dprintc() is correct, whereas the information given by the printf() in main is a lie :( what am I doing wrong?
mb is uninitialized in main.
!!! Can't believe I was scratching my head for half an hour because of a few missing characters :(
This happens to me a lot in programming; for example, I end up coding math equations the wrong way because I forgot to add or multiply something. :(
Don't fret. I've done the same time more than I can count. Sometime it take a second pair of eyes, but usually what works for me is to leave it alone for a while and then come back later with your own fresh eyes. I had a Java assignment one time that I was puzzling and puzzling over for hours. I finally gave up and posted a question either here or elsewhere. I got a response notification so I pulled up the code before going to the answer and I spotted the error almost immediately.
Join our real-time social learning platform and learn together with your friends!