L2 - Arrays Flashcards
clang
Compiler we’re using when we run the program make/ code
How do you link libraries with a command line argument when compiling with clang?
-l
clang -o hello hello.c -lcs50
This links and renames the file
What are the four steps to turn source code into binary?
- pre-processing
- compiling
- assembling
- linking
Pre-Processing
Converts the included libraries (#include <stdio.h>) and adds the prototypes to the top of the file to be able to use all functions in that .h file</stdio.h>
Compiling
Convert source code to assembly code.
Assembling
Takes assembly code and converts to 0/1s
Linking
Pulls all 0/1s in all of the files together.
Debugging
Running through code to figure out issues.
Break point.
Point to pause execution of code, which is by adding a dot in the gutter. It stops at the first line of executable code, on or right after the breakpoint. The highlighted code has not been run yet.
Garbage values
Values that are present before variables are set.
Step over
Execute but don’t get into full detail.
Step in
Walkthrough the function step by step in detail
Step out
Pulls you out of the step by step detailed function to execute without full details.
Arrays
Sequence of values stored in memory without any gaps in between them with a 0 index, so position 1 is 0.
What is this?
int scores [3];
declaration of an integer array called “scores”, with a length of 3