[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

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
0
Kokas79
Asked:
Kokas79
1 Solution
 
soumya_paridaCommented:
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.
0
 
rajaloysiousCommented:
check this if it is helpful
http://www.csharphelp.com/archives/archive36.html

cheers
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now