Is there a way to dynamically include source code in C like in PHP?

Started by
5 comments, last by Sae Mu 5 years, 6 months ago

Which the compiler then composes?
Like in PHP?

#include <stdio.h>
require `inc_struct_declarations.c`;  
require `inc_functions.c`;  

int main()
{
require `inc_var_declarations.c`;
require `inc_keyb_events.c`;
require `inc_game_logic.c`;
require `inc_gfx_output.c`;

   return 0;
}

Advertisement

#include does exactly that - copies the source code out of the requested file and pastes it at that location. 

on any location in the Source Code like in my example?

Yep.

Thank you Guys.

I will try it out :-)

I'm using Notepad++

#include "structs.inc.c" etc. works fine

thank's

 

This topic is closed to new replies.

Advertisement