Answer the following questions relating to the build process

Answer the following questions relating to the build process: What step of the build process takes a translation unit as its input? What output is generated from the step described in a)? What output is generated when one or more of b) are linked?

Solution

Answer:(a)-->

When a C preprocessor read the source file, It includes the header files and macro definations into the translation unit,reads and processes all of the macros then discards all of the macros when it has finished.(let the source file is myfile.cpp).compiler creates a preprocessor file known as myfile.i

Answer(b)-->The compiler works with one translation unit at a time. A translation unit is a .c file that has passed through the pre-processor. when macro expension is done, The compiler produces relocatable object files – .o files.
The object file contains the compiled source code – opcodes and data sections.

it contains all the information of macros and preprocessive directive.

Answer (c)

The linker concatenates object files and library files to create a program and creates a myfile.exe, An executable file.

 Answer the following questions relating to the build process: What step of the build process takes a translation unit as its input? What output is generated fr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site