inclusion guard help
Hello I am trying to make a game and i disided to break it up into several files using headers to hold all the variables and that kind of stuff but i need to include the headers into all of the CPP files so i know i need to use inclusion guards but they just dont seem to work at all. its like the preprocessor just skips over the #ifndef command can some one help me with this?
i have a book that says to use this set up:
#ifndef Lybraries_h // the book says that the file name does need to be capital
// everthing here
You did pick a different name for each file right?
If my header file is say myfuncs.h, then it's include guard would be
If you pick the same #define name for different files, then yes the latter ones will be skipped.
I dont think i compleatly understand do you think you could give an example.
ps.i only have one file that i am including into all the other files, I made it with all the variables in it