Skip to content

Instantly share code, notes, and snippets.

@abdalmoez
Last active February 20, 2020 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdalmoez/af2e0038580e5314d62831da1fc779fb to your computer and use it in GitHub Desktop.
Save abdalmoez/af2e0038580e5314d62831da1fc779fb to your computer and use it in GitHub Desktop.
Usefull macro to convert enum to string
#include <iostream>
#define STR(p) #p
enum {
Tool,
Main
};
int main()
{
std::cout<< STR(Tool) << std::endl<< STR(Main);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment