translation unit에 대해서

조회수 3173회

C의 static 함수는 왜 쓰는 건가요?에서 translation section이라는 말이 나오는데 이게 정확히 뭘 뜻하는 건지 알고싶습니다

1 답변

  • 좋아요

    0

    싫어요
    채택 취소하기

    translation unit은 C++ compilation의 기본 단위입니다. <소스 파일 하나 + 직접/간접적으로 include된 헤더파일의 내용물(전처리기 조건에 따라 몇몇은 무시)>로 구성되어 있습니다.

    translation unit 한개는 object file, library나 실행가능한 프로그램으로 컴파일 될 수 있습니다.

    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.
    

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)