Mk đang học C, đọc đến phần translation unit thì ko hiểu nó là gì. Mn thông não giúp mk vs???!!!
Translation Unit trong C là gì?
Đây là định nghĩa trong C standard:
A source file together with all the headers and source files included via the preprocessing directive #include
is known as a preprocessing translation unit. After preprocessing, a preprocessing translation unit is called a translation unit.
Hiểu theo định nghĩa này thì translation unit trong C là file .c đã trải qua bước preprocessing. Ở bước preprocessing thì tất cả nội dung của file được nhắc đến bởi chỉ lệnh #include sẽ được copy vào trong file .c, vì vậy nên trong C standard mới nhắc kèm đoạn "A source file together with all the headers and source files included via the preprocessing directive #include
"
Ngoài ra các macro và các loại #if
được trình preprocessor thay hết theo định nghĩa. Các chỉ lệnh #pragma
vẫn được giữ lại vì nó dành cho compiler.