C Programming: Preprocessor, include files from macro
If I could find a way to do something similar to this, I could cut out hundreds of lines of code in my application, and dramatically increase maintainability. Anyone have any ideas? #include <stdio.h> int main( ) { #define include_all_files(root) \ #include #root "1.h" \ #include #root "2.h" \ #include #root "3.h" \ #include #root "4.h" include_all_files( first_library ) include_all_files( second_library ) include_all_files( third_library ) return 0; } EDIT : I appreciate the responses, my example seems to be causing a misdirection in effort, so here is the problem I am actually trying to