Alex Rivera | Logout

What is a "translation unit" in C++?

Asked 2009-07-09T20:01:13.810
346

I am reading at the time the "Effective C++" written by Scott Meyers and came across the term "translation unit".

Could somebody please give me an explanation of the following:

  1. What exactly is it?

  2. When should I consider using it while programming with C++?

  3. Is it C++ only, or can it be used with other programming languages?

I might already use it without knowing the term...

Edit
Report

2 Answers

0

Every cpp/c (implementation) file will be converted into a translation unit (ie.,object file (.obj)) headers in the cpp file will be replaced with the actual text from the header files.

answered 2009-07-09T20:06:06.247
0

In my view, a "translation unit" is typically a single "post-preprocessing" source file. You can get more details on this MSDN page. http://msdn.microsoft.com/en-us/library/bxss3ska(v=vs.80).aspx

answered 2013-07-29T20:08:34.657

Your Answer