CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@sheena rewari • 20 Aug, 2012
could you please tell me 5 difference between a macro and pre-processor??😀
@Kaustubh Katdare • 20 Aug, 2012
sheena rewari
could you please tell me 5 difference between a macro and pre-processor??😀
Post moved to a new thread in CS/IT/Networking engineering section.
@sheena rewari • 20 Aug, 2012
sheena rewari
could you please tell me 5 difference between a macro and pre-processor??😀
Macros, which are special lines/fragments of code, differ from any other code written in the source files in the aspect that it's not passed to the compiler (either for the purpose of encoding into machine instructions, or some intermediate form instructions).

Preprocessors, statements that tell the programming language to perform such task as combining source program files prior to compilation.


@Neeraj Sharma • 20 Aug, 2012 As far as I know. Macro is formed using a preprocessor #define.

For ex: #define pi 3.14

This substitution is made in the pre-processing state itself where header files are included
@varsha shaw • 02 Dec, 2018 • 1 like

Difference between preprocessor and macro


@Radhika Deshpande • 03 Dec, 2018

Preprocessor is the program that does the preprocessing like file inclusion,compilation, macro expansion. So that means lines that start with # are preprocessing directives. They are directives that tell the preprocessor to do something.


examples are - #include <header_name>

or #if <value>


macros are name for fragment of code. 

e.g #define buffer_size 100

Here whenever yuo use macro buffer_size it will get replaced by value 100

@Durgesh Srivastava • 26 Jan, 2020

A macro processor is a program that copies a stream of text from one place to another, making a systematic set of replacements as it does so. ... A preprocessor is a program that processes its input data to produce output that is used as input to another program.Macro: a word defined by the #definepreprocessor directive that evaluates to some other expression.Preprocessor directive: a special #-keyword, recognized by the preprocessor. preprocessor modifies the source file before handing it over the compiler. Consider preprocessor a program that runs beforecompiler.



7.3k views

Related Posts

@Kaustubh Katdare · Aug 13, 2015

The Indian Engineering Services exam aka IES age limit is 21 to 30 years. Any aspiring candidate who wants to take the IES exam will have to be of or...
8.2k views

@Ankita Katdare · Oct 10, 2014

While reading an answer on Quora, I stumbled upon this link - 10 things I wish I knew about getting an MBA. It got me thinking. Thousands of Indian graduates...
5.3k views

@Neha Kochhar · Jan 17, 2010

What is the value of the expression (3^6) + (a^a)? a) 3 b) 5 c) 6 d) a+18 e) None I am Unable to solve this Out? Ans is 5...
6.6k views

@Abhishek Rawal · Aug 6, 2015

On 17th of March, DRI3 support was added to xf86-video-ati. However, to enable DRI3, you have to edit xorg.conf in order to enable it. Commit link : https://cgit.freedesktop.org/xorg/dr.../?id=64e1e4dbdd3caee6f5d8f6b6c094b4533fa94953 1) Create...
4k views

@Anil Jain · Aug 7, 2013

If you are a Chrome lover and Chrome is not automatically doing updates to your browser then there can be following two reasons of the same: - Administrator has disabled...
4.5k views