In assembly when you add a number to another number, you have the carry flag to detect if the add resulted in an overflow.
In C, what is the best/most optimal way to do the same?
Let's say we have two:
And then we add them:
One way is to use a larger variable, or count on C taking these uint8_t up to a uint16_t:
That seems less than optimal and what if c1/c2 are scaled to 16 or 32 bits...
What thoughts do you guys have?