Exam 01 Piscine 42 Exclusive

i = 0; while (src[i]) i++; dest = malloc(sizeof(char) * (i + 1)); if (!dest) return (NULL); i = 0; while (src[i])

| Case | a | b | Expected | Result | |----------------|-------|-------|----------|--------| | Both zero | 0x00 | 0x00 | 0x00 | pass | | Same non‑zero | 0xFF | 0xFF | 0x00 | pass | | Complement | 0x0F | 0xF0 | 0xFF | pass | | Single bit | 0x01 | 0x00 | 0x01 | pass | | Arbitrary | 0x5A | 0x3C | 0x66 | pass | exam 01 piscine 42 exclusive

unsigned char xor_bit = (bit_a | bit_b) & ~(bit_a & bit_b); i = 0; while (src[i]) i++; dest =