As pointed out in the comments by Wumpus Q Wumbley, for "standard" utilities/exit codes, there are a set of macros in <sys/wait.h>
that are useful and recommended for extracting information from the exit codes. However, if the exit codes you're trying to process don't follow those usual conventions, you can extract individual bits with a simple logical AND operation like this:
int bit_7_is_set = result & (1U << 7); // a.k.a. 128
If the result of the AND operation is non-zero (it will either be 0 or 128 in the above case), the corresponding bit is set in the result
.