CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Pensu

    MemberDec 5, 2011

    As far as i have studied macros are preprocessor directives. Now, preprocessor directives are executed before actual compilation of the code. As you might know their value is replaced in the program before the code gets compiled. Or in simple language you can say preprocessor directives is a concept and macros are entities.
    I know this is a bit ambiguous, but i hope it clears your doubt.

    P.S: Correct me if i am wrong.
    Are you sure? This action cannot be undone.
    Cancel
  • Ankita Katdare

    AdministratorDec 5, 2011

    Whoa! How will you compare these two terminologies?

    A preprocessor is a program that processes its input data to produce output that is used as input to another program.
    The output is said to be a preprocesed form of the input data, which is often used by some subsequent programs like compilers.

    Thus, the C preprocessor handles directives for source file inclusion (#include), macro definitions (#define), and conditional inclusion (#if).
    An example of Macro Expansion:
    #define PI 3.1415
    
    Above definition lets you use "PI" instead of every occurrence of 3.14159.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register