Thread: C preprocessor

  1. #1
    Unregisterd
    Guest

    Unhappy C preprocessor

    I saw in a document ,which says that (it was on C preprocessor) the OS will set a macro names SYSTEM which will be equal to the OS currently running. For example if it is a MS-DOS system , SYSTEM will qual to MSDOS, and the example given was,
    #if SYSTEM==MSDOS
    .
    .
    .

    How true is the fact that the OS sets a macro named SYSTEM. Pls explain.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > How true is the fact that the OS sets a macro named SYSTEM.
    Not true at all generally speaking. Any such macro name would be set by the compiler, and as such would be compiler specific.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C/C++ preprocessor directives
    By coletek in forum C++ Programming
    Replies: 11
    Last Post: 01-11-2009, 04:24 PM
  2. Writing an HTML Preprocessor
    By thetinman in forum C++ Programming
    Replies: 1
    Last Post: 09-17-2007, 08:01 AM
  3. Preprocessor Directives Problem
    By MipZhaP in forum C++ Programming
    Replies: 6
    Last Post: 02-18-2005, 01:53 PM
  4. Preprocessor string pasting fun
    By ggambett in forum C Programming
    Replies: 6
    Last Post: 11-11-2004, 06:40 PM
  5. Preprocessor Functions
    By mart_man00 in forum C Programming
    Replies: 2
    Last Post: 01-09-2003, 09:58 PM