Run C++ code inside a file.

I'd have a text file,contains C++ code.

How can I,in the main(), read the file and treat it as header (I mean read and compile that code) ?

Just asking,because I should find another way to read data,not having to parse.
Last edited on
Please elaborate, if you have the text file why not make it a header?
I'm writing a game

There are a lot of characters...each data file contains infos about :

I have a spritesheet, with

1
2
3
4
5
//Character Constants
const int CHAR_STAND_RIGHT = 0;
const int CHAR_STAND_LEFT = 1;
const int CHAR_JUMP_LEFT = 2;
const int CHAR_JUMP_RIGHT = 3;


I can make them an array

1
2
3
4
character[CHAR_STAND_RIGHT].x = 60;
character[CHAR_STAND_RIGHT].y = 60;
character[CHAR_STAND_RIGHT].h = 60;
character[CHAR_STAND_RIGHT].w = 60;


With informations to clipping (cut them from the spritesheet) .

If I include in a header,how large would it be... ?
You need to include that as a header.
Topic archived. No new replies allowed.