Write a preprocessor command that uses the # operator in macro expansion.
Difficulty level
This exercise is mostly suitable for students
#include <stdio.h>
#define OUT(x) printf(#x " is equal to %d.\n", x)
int main()
{
int value = 123;
OUT(value);
return 0;
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Deepest element in a binary tree