http://dannipenguin.livejournal.com/ ([identity profile] dannipenguin.livejournal.com) wrote in [personal profile] theducks 2008-08-05 04:27 am (UTC)

You're seeing the difference between a signed char and an unsigned char (why does C say char can have a sign? who knows). Bitwise, they are the same value: http://en.wikipedia.org/wiki/Two%27s_complement

It's worth noting that man 3 getopt (first point of call) tells you that -1 is returned when there are no more options to pass and that getopt() returns an 'int', not a 'char'.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting