Forum : ST7/STM8
Original Post
Post Information | Post |
---|---|
November 19, 2008 - 11:01am
|
code is : |
Forum : ST7/STM8
Post Information | Post |
---|---|
November 19, 2008 - 11:01am
|
code is : |
Hello Fuzhike,
The C standard does not specify whether the "char" type is signed or not. In your case, it is unsigned.
So "a = -1" is equivalent to "a = 0xFF", which explains you problem.
Just declare a and b as signed using:
I hope this helps,
Bruno