Week 2 - Array Flashcards

1
Q

The 4 steps of compiling source code into machine code.

A

1-preprocessing

2-compiling

3-assembling

4-linking

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

What is Preprocessing?

A

It looks for header files we include such as , since it contains content, like prototypes of functions that we want to include in our program

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

What is compiling?

A

It takes our source code, in C, and converts it to another language called assembly language

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

What is assembling?

A

It takes the code in assembly and translate it to binary or machine code by assembling it

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

What is linking?

A

Linking is the process of combining all the machine code into our one binary file

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

The size of each different type of data

A

bool, 1 byte
char, 1 byte
float, 4 bytes
int, 4 bytes
double, 8 bytes
long, 8 bytes
string, ? bytes, it takes up a variable amount of space since it could be short or long.

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

What are strings?

A

Strings are just arrays of characters terminated with a null character \0

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

Why we need the Null character or \0?

A

Because it helps our program to know where the string ends. Since strings had no fixed size in memory

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

What are command-line arguments and what do they do?

A

Command-line arguments are simply arguments that are set after the name of the program
and they simply used when we tend to ask the user for input and there’s no size specified because we don’t know how big that will be

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

What does main function return?

A

it returns an integer value called an exit status which is 0 to indicate that nothing went wrong and our code has run successfully.

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

What happens when we write:
return 1;
and why do we write it at all?

A

we called a non-zero exit status which is a kind of “Handmade” error message written by the programmer itself to tell the user that they did something wrong which caused the program to exit early

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

What are the stages of Cryptography or what do we need to build its system?

A

Plaintext: the original message, or input
Key: additional number with the input
Cipher: the algorithm that does the scrambling
Ciphertext: the encrypted message, or output

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