954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

De"ify?

I know that this #define QUOTE(X) #X turns X into a c-string version of whatever is passed to it. my question is if there is a way to do this in reverse ie: #define DEQUOTEANDCALLFUNCTIONORCLASSWITHGIVENNAME(X) (X#)() is this possible?

Labdabeta
Posting Pro in Training
489 posts since Feb 2011
Reputation Points: 27
Solved Threads: 18
 

This is a question that comes up from time to time on forums on C++. And, I'm convinced now that there is no way to do this. I hope I'm wrong, but I think there is little chance.

mike_2000_17
Posting Virtuoso
Moderator
2,139 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
 

I feared as much :( time to write a function filled with string comparisons to each function I write... thanks anyways.

Labdabeta
Posting Pro in Training
489 posts since Feb 2011
Reputation Points: 27
Solved Threads: 18
 

>>time to write a function filled with string comparisons to each function I write...

There is certainly a better solution than doing this. What are you trying to achieve?

mike_2000_17
Posting Virtuoso
Moderator
2,139 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: