Skip to main content

Practice ยท 2 of 4

Stringize with Double Expansion

CHALLENGE
Difficulty: advanced+25 XP

Given the classic wrapper pair already in your editor (STR_ and STR) and a file-scope #define BUILD_ID 77, implement const char *id_string(void) returning STR(BUILD_ID) โ€” the expanded value as text โ€” and const char *id_raw(void) returning what STR_(BUILD_ID) yields: the bare token name.

Back to lesson: Practice: Preprocessor Mechanics Drills