Stringifying your C++ MACRO

Rahul Bhadani
2 min readNov 8, 2020
Image Courtesy: Liam Briese (https://unsplash.com/photos/pH3OM-Vy3FM)

Do you know that you can also stringify the MACRO?

Sometimes you want to convert MACRO arguments into a string constant. This is achieved by the stringification of MACRO.

“Stringification” means turning a code fragment into a string constant whose contents are the text for the code fragment. For example, stringifying foo (z) results in “foo (z)”.

--

--

Rahul Bhadani

Asst. Professor, @UAH | @uarizona PhD, ECE | Intelligent Transportation & Quantum Science Researcher | Donation: https://www.buymeacoffee.com/rahulbhadani