Thread: preprocessor directives

  1. #1
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003

    preprocessor directives

    I am just doing some research. I have been to some of these websites just looking at some of the rare preprocessor directives:

    I was just wondering if anyone would be generouse enogh to write a little code using some of the awkward ones like:

    I think I sort of understand the using one but not sure. Is it like compiling with another object file(.o) I would really appreciate anyone's suggestions.
    P.S. I have also found questions on the board on the #pragma and #line but still don't understand

  2. #2
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    I'm assuming you've used google alread so:
    not using vc++ so don't know about
    here is some the first I found on a site and modified it, the second I coded to test writing macros with the #define directive
     ** This example illustrates some predefined macros.
    #pragma langlvl(ANSI)
    #include <stdio.h>
    #if __STDC__
    #   define CONFORM    "conforms"
    #   define CONFORM    "does not conform"
    int main(void)
      system("TITLE C macros");
      printf("Line %d of file %s has been executed\n", __LINE__, __FILE__);
      printf("This file was compiled at %s on %s\n", __TIME__, __DATE__);
      printf("This program %s to ANSI/ISO standard C\n", CONFORM);
      return 0;
    Here is one site that talks about macros.
    Last edited by caroundw5h; 12-16-2003 at 10:33 PM.

Popular pages Recent additions subscribe to a feed