I just need to know the difference between two int variables a
and b
.
I'm new to Objective-C.
I just need to know the difference between two int variables a
and b
.
I'm new to Objective-C.
int diff = a - b;
or if you need the absolute difference:
int abs_diff = abs(a - b);
and if there is any chance that your expression might overflow:
int abs_diff = max(a, b) - min(a, b);