#define TRACE(arg1,...) char* arg1;
int main(void)
{
int a=4;
TRACE(("Hello",a)); // convert "Hello" to a valid char variable name.
return 0;
}
I'm having trouble in converting the string "Hello"
into a variable name.
for example: "Hello"
should be converted as const char* Hello;
by using a macro. Since there are double quotes I'm unable to convert it. This is my first question in Stack Overflow.
You can't "destringify" a string in C.
You can stringify a token, though, so the solution is to do it the other way around: use the token hello
and stringify it when you need "hello"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With