Builds Flashcards

1
Q

What is program building?

A

The creation of an executable from one or more source files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a program executable?

A

A file that contains machine code instructions (instructions are OS and CPU dependant)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two steps required for transforming C code into an executable?

A

Compilation and linking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does preprocessing do?

A

It interprets all the preprocessing directives of one source file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do preprocessing directives begin with?

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the input and output of preprocessing?

A

Input: source code from one source file
Output: New source code with substitutions incorporated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a header file?

A

File containing information needed by multiple source files, such as data type definitions and function prototypes. It never contains function implementations or any statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Use ______ to include a header file from a library

A

angle brackets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Use ______ to include a header file from the current directory

A

double quotes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does compiling do?

A

Translates source code into assembly code while performing optimizations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Compiler input:

A

Source code from one source file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compiler output:

A

The corresponding assembly code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does assembling do?

A

It translates assembly code into object code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Assembler input:

A

Assembly code from one source file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Assembler output:

A

Corresponding object code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does linking do?

A

Combines code from multiple object files into one executable

17
Q

Linking input:

A

Object code from multiple object files, including library ones

18
Q

Linking output:

A

One executable file

19
Q

Why do we separate compiling and linking?

A

Object files may come from different source languages, you can link object code from libraries into your executable, you only need to recompile the source files that have changed

20
Q

What is a library?

A

A collection of related functions written by other programmers

21
Q

To use a library:

A

Include the library header file, using a preprocessor directive, OR link in the library object file

22
Q

What are the two types of linking?

A

Static linking and dynamic linking

23
Q

What is static linking?

A

The library object code is copied into the executable- results in larger but faster executable

24
Q

What is dynamic linking?

A

Default setting- object code is loaded at runtime. There’s a smaller executable, but slower execution time

25
Q

What is a makefile?

A

Text file called Makefile with no file extension

26
Q

What are Makefiles used for?

A

Managing the dependencies between files

27
Q

Why use a makefile?

A

It keeps track of what needs to be recompiled

28
Q

How do makefiles keep track of what needs to be recompiled?

A

Comparing timestamps

29
Q

What’s a makefile macro?

A

Similar to a variable, they can be used to define groups of files and specify compilation options