Thank u, i dont need any technical explanation just i wanna kno bout where preprocessor would be more helpful... that means which kinda applications or programs.... Is it really a most effective topic
Well, basically using a preprocessor should improve readability of the code and
should help you in typing consistent code on a very basic level. You can define
macros that you can use throughout your code. e.g. the following (sloppy) macro
is a shorthand for the maximum value of two values x and y:
-
#define MAX(x, y) (((x)>(y))?(x):(y))
-
... so instead of typing (or reading!) all those nasty brackets and magic expressions
you can simply do:
But note that this macro (as well as many macros) has a flaw, i.e. it evaluates
the value of the maximum twice and macros hide those facts. More modern
languages have other solutions instead of preprocessor macros for that.
kind regards,
Jos