Hi
I am using the -= operation on a uint8_t number but when I debug / execute the number does not reduce by the value I give it, done anyone know why?
...Code:uint8_t number; number = 15; number -= 13;
Number still equals 15?!?
thanks
Hi
I am using the -= operation on a uint8_t number but when I debug / execute the number does not reduce by the value I give it, done anyone know why?
...Code:uint8_t number; number = 15; number -= 13;
Number still equals 15?!?
thanks
Provide the smallest and simplest compilable code that demonstrates the problem. Chances are, you made a mistake elsewhere.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
My first guess would be simple oversight on your behalf.
Example:
Something like that should work, if not then feel free to post back.Code:int main(void) { int number = 15; printf("number = %d\n", number); number -= 13; printf("number - 13 = %d\n", number); getchar(); return 0; }