About translation unit

Asked 2 years ago, Updated 2 years ago, 21 views

Why write the static function of C?In , the word translation section comes out, and I want to know exactly what it means

c++

2022-09-21 21:13

1 Answers

The translation unit is the basic unit of C++ compilation. It consists of <One source file + the contents of the included header file (some ignored depending on preprocessor conditions)>.

One translation unit can be compiled into an object file, library, or executable program.

C++ standard :

A translation unit is the basic unit of compilation in C++. It consists of the contents of a single source file, plus the contents of any header files directly or indirectly included by it, minus those lines that were ignored using conditional preprocessing statements.

A single translation unit can be compiled into an object file, library, or executable program.

The notion of a translation unit is most often mentioned in the contexts of the One Definition Rule, and templates.


2022-09-21 21:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.