Week 2 - Array Flashcards
The 4 steps of compiling source code into machine code.
1-preprocessing
2-compiling
3-assembling
4-linking
What is Preprocessing?
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
What is compiling?
It takes our source code, in C, and converts it to another language called assembly language
What is assembling?
It takes the code in assembly and translate it to binary or machine code by assembling it
What is linking?
Linking is the process of combining all the machine code into our one binary file
The size of each different type of data
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.
What are strings?
Strings are just arrays of characters terminated with a null character \0
Why we need the Null character or \0?
Because it helps our program to know where the string ends. Since strings had no fixed size in memory
What are command-line arguments and what do they do?
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
What does main function return?
it returns an integer value called an exit status which is 0 to indicate that nothing went wrong and our code has run successfully.
What happens when we write:
return 1;
and why do we write it at all?
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
What are the stages of Cryptography or what do we need to build its system?
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