What does the '#' symbol do after the second define? And isn't the second line enough? Why the first one?
#define MAKESTRING(n) STRING(n)
#define STRING(n) #n
What does the '#' symbol do after the second define? And isn't the second line enough? Why the first one?
#define MAKESTRING(n) STRING(n)
#define STRING(n) #n
Copyright © 2021 Jogjafile Inc.
This is stringize operation, it will produce a string literal from macro parameter, e.g.
"n". Two lines are required to allow extra expantion of macro parameter, for example: