Is there a way to do something like switch cases with #includes?

Hello,

im having a problem with a program. It solves different problems and i import the example problems using #include examplea.h
Having multiple examples made my program look like this:
#include examplea.h
//#include exampleb.h
//#include examplec.h
etc...

I wonder if there is anyway to choose the example.h file using an input (like giving the name of the example).
My "solution" so far is to use a script to replace the example.h file with the next one and so on.
Im wondering if there is any way i could solve this using C++ instead of a shell script.

Thanks for any help.
You're not really clear on what you're trying to do:
If you're trying to change the final program at runtime, this solution is definitely not going to work.
If you're simply trying to change the code before it's being compiled, read the tutorial:
http://www.cplusplus.com/doc/tutorial%20%20/preprocessor/
Topic archived. No new replies allowed.