#ifdef #endif

This is a discussion on #ifdef #endif within the C++ Programming forums, part of the General Programming Boards category; Hi, What does "#ifdef" and "#endif" stand for are these some sort of macros to check if something is defined?? ...

  1. #1
    Unregistered
    Guest

    #ifdef #endif

    Hi,

    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
    Posts
    163

    all I know

    they are used in header files
    +++
    ++
    + Sekti
    ++
    +++

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    108
    #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, 12:49 PM
  2. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 10:42 PM
  3. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  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, 10:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21