Thread: #ifdef #endif

  1. #1

    #ifdef #endif


    What does "#ifdef" and "#endif" stand for are these some sort of macros to check if something is defined??

    Any help would be appreciated.

  2. #2
    Registered User Sekti's Avatar
    Join Date
    Feb 2002

    all I know

    they are used in header files
    + Sekti

  3. #3
    Registered User
    Join Date
    Dec 2001
    #ifdef and #endif are preprocessor directives used mostly in .h files. These particular directives, along with #ifndef, are used for instance as "include guards". Include guards in header files containing class declarations is one very good use of these. Multiple declarations of a class in C++ is forbidden.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of an integer pointer
    By onebrother in forum C Programming
    Replies: 5
    Last Post: 07-09-2008, 11:49 AM
  2. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 09:09 PM
  5. MFC Assertion Failure
    By maxthecat in forum Windows Programming
    Replies: 5
    Last Post: 08-01-2002, 09:58 AM