How does C# compilation get around needing header files?

后端 未结 5 683
时光取名叫无心
时光取名叫无心 2020-12-07 09:58

I\'ve spent my professional life as a C# developer. As a student I occasionally used C but did not deeply study it\'s compilation model. Recently I jumped on the bandwagon a

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 10:29

    It uses the metadata from the reference assemblies. That contains a full type declaration, same thing as you'd find in a header file.

    It being a two-pass compiler accomplishes something else: you can use a type in one source file before it is declared in another source code file.

提交回复
热议问题