Made my own header, problems..

Okay so I am making a program using a custom #define file that I have constructed.

The define file contains a bunch of questions in the form of:

1
2
#define QUESTION_1 "The hash (#) is a directive for what? 
#define QUESTION_2 "CTRL-* will kill an infinitely looping program. 


What I am having a lot of trouble wrapping my head on how to accomplish is how I can have my program randomly generate one of the "QUESTION_X" definitions. I've tried sticking variables where the number would go, but to no success.

I know the define function can be a pain to work with because C treats them as so precious...

Thanks for all help!
I know the define function can be a pain to work with because C treats them as so precious...
Or because you're using it wrong.
I can be done with the preprocessor, but it's also unnecessary. We have arrays for a reason.

1
2
3
4
char *questions[]={
    "The hash (#) is a directive for what?",
    //... (the last item should have a comma after it)
};
Last edited on
Topic archived. No new replies allowed.