I am trying to define a macro in C++ that puts quotes around a variable.
A simplified example of what I am trying to do is this:
#define PE(x) std::cout << "x" << std::endl;
and then when I type PE(hello)
in my code, it should print hello
; but instead it just prints x
.
I know that if I make it:
#define PE(x) std::cout << x << std::endl;
and then type PE("hello")
then it will work, but I would like to be able to be able to use it without the quotation marks.
Is this possible?