quote:
Original post by Vegeten
Pretty cool source code, though it's too complicated for me since I don't understand #define and all.. Thanks, and good job!
#defines are very easy... Let me see if I can explain.
#define basically just sets a constant value. For example...
#define PLAYERNUMBER 1cout<<"You are Player Number "<<PLAYERNUMBER;output:You are Player Number 1
oh, and if you are refering to the inclusion guards, here is the explanation
when you see this in a header file...
//Inclusion Guard#ifndef INC_CVTTT_H#define INC_CVTTT_H......#endif //INC_CVTTT_H
what this does is...
1) Checks to see if INC_CVTTT_H has been #defined. INC_CVTTT_H is just a unique variable name and doesn't really mean anything.. If it hasn't been defined, then...
2) it #defines INC_CVTTT_H
3) it includes all the header information
Now, the next time that header is read... INC_CVTTT_H is already #defined, so it doesn't reread all the header information, it simply skips down the the #endif.
Hope i made sense
~~~~~~~~~~~
Chris Vogel
~~~~~~~~~~~
[edited by - Radagar on August 7, 2002 5:36:14 PM]