Link to home
Start Free TrialLog in
Avatar of Kokas79
Kokas79

asked on

Makros?

Hello

I was asked in an interview if C# uses makros or a preprocessor? Now...i had no idea what those things are...i just answered "with C# you can use pre-processing directives...like the region one i saw generated by Visual Studio.Net..so it's not macros"

what are the macros and how are they used?

Thanks
Avatar of soumya_parida
soumya_parida
Flag of United States of America image

if you have coded in c, then its the directive statement which usually comes in the begining like
#define ADD(x,y) x+y

So wherever in the code you have ADD(x,y) it is replaced by x+y while compiling.
Note x and y can be any integers.
YOu can also define constant using this directive.

Similarly other preprocessors are #include
used to import other code/header files.
ASKER CERTIFIED SOLUTION
Avatar of rajaloysious
rajaloysious

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial