Skip to main content

Practice ยท 4 of 6

Signed or Plain char?

CHALLENGE
Difficulty: advanced+25 XP

Plain char signedness is implementation-defined. On a typical x86-64 Linux box plain char is signed; on this machine it is not โ€” implementation-defined means the platform decides and your code must adapt. Implement void program(void) that prints two lines: `` plain char: <signed|unsigned โ€” derived> min value: <CHAR_MIN> ` Derive BOTH facts at runtime: assign (char)-1 and compare with -1 (signed) or 255 (unsigned), then print CHAR_MIN from <limits.h>`. Your output here may differ from x86-64 โ€” that difference is the lesson.

Back to lesson: Practice: Object Layout Forensics