Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <limits.h>
- void f(signed int si_a, signed int si_b) {
- signed int sum;
- if (((si_b > 0) && (si_a > (INT_MAX - si_b))) ||
- ((si_b < 0) && (si_a < (INT_MIN - si_b)))) {
- /* Handle error */
- } else {
- sum = si_a + si_b;
- }
- /* ... */
- }
- puts("Welcome to C!" );
Add Comment
Please, Sign In to add comment