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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
#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.