Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the scope of a MACRO

Tags:

c

macros

I have a general doubt ..

Is there a way we limit the scope of a MACRO within a .C file just like a static function ?

like image 290
codingfreak Avatar asked Dec 22 '25 11:12

codingfreak


1 Answers

Macros are done by the pre-processor. The pre-processor reads all files being processed and applies macros and macro logic, the results of which are then passed to the compiler.

Once a macro is defined, its value will be used everywhere the macro is referenced, even in other files.

Please see the GCC Documentation for details regarding macro usage.

like image 86
Ariel Avatar answered Dec 24 '25 01:12

Ariel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!