Lectures 1 - 6 Flashcards

(19 cards)

1
Q

Building a C program. First step:

A

(Source Code)

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

Pre-processor

A

Executes all the pre-processor directives

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

Compiler

A

Generates assembly code for one or more architectures

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

Assembler

A

Generates binary Object code

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

Linker

A

Links all objects with binaries and generates an executable.

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

C types

A

Unsigned integers, signed integers, floating point numbers.
char, short, int, long, and long long.

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

struct keyword

A

Structures are aggregates of basic data types

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

CPU

A

An electronic circuit in charge of control, logical, arithmetic and I/O operations

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

Arithmetic and Logical Unit (ALU)

A

Handles arithmetic, math, and bitwise operations

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

Control Unit (CU)

A

In charge of reading and writing in memory and directing the ALU

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

What does the Pre-processor do?

A
  • Removes comments
  • Directives, which always comes with a #. Checks if there are any replacements
  • Pull in entire files

The pre-processor modifies the source code for the compiler.

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

What is a pointer?

A

A value that happens to be an address. Or a variable that stores the address of another variable.

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

Difference between * and *

A
  • = Used to go from an address (pointer) to the value in that memory location.

&. The address-of operator, &, is used to create a pointer to a variable.

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

Pass by value (Option)

A

Copy the value to the function. An original and a copy that can be changed.

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

Pass by pointer (Option)

A

Stores the address of another variable

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

Pass by reference (Option)

A

Provide a reference to the value to the function.

17
Q

Problem with Pass by value.

A

Expensive for large objects and uses extra memory.
The function can’t change the parameters

18
Q

Problem with Pass by pointer.

A

Function might change them and could be an issue when calling library code.

19
Q

Problem with Pass by reference.

A

Involves a dereference operation.