Use the preprocessor to convert code into a string
问题 Disclaimer: I am not a C programmer. I have recently seen a friend's project. Due to reasons I don't understand, he writes code in a string which is compiled at runtime. This results in something like: char x[] = "int y = 5; printf(\"%i\", y)"; run_this_code(x); Which is horrible to use because Visual Studio doesn't step in and do syntax highlighting etc. Using some preprocessor abuse, it is possible to do trick Visual Studio into thinking you're writing real code and then having the