Scope of #define preprocessor in C

前端 未结 6 1850
孤街浪徒
孤街浪徒 2020-12-09 09:19

The scope of #define is till the end of the file. But where does it start from. Basically I tried the following code.

 #include
          


        
6条回答
  •  孤城傲影
    2020-12-09 10:08

    Preprocessor has no concept of "scope" -- it manipulates the text of the program, without any idea of what the text is

    Symbol is defined from its definition until the end of the compilation unit (a source file and and files it includes)

提交回复
热议问题