Lecture 2 - C Basics Flashcards
Is C object-oriented?
No
What is the difference between Java and C when OOP is ignored?
How memory is managed and how the program is executed.
What does -Werror do?
Turns all warnings into errors making the program impossible to compile until all warnings have been fixed.
What does the -Wall flag do?
The -Wall flag enables most compiler warnings
What are make files?
Files that allow building of C programs automatically -> with a command.
Are make files C exclusive?
No, they can be used for any command line interface command.
What is the first line of a make file made up of?
[targets] : [sources]
- sources can be thought of as dependencies
What does typing make in the CLI do?
Execute the first command in the make file.
What does every C program have ?
An entry function called main.
Do we need to return anything from a main function?
No, 0 is automatically returned by the function.
0 indicates successful execution
What does a non-negative value returned from main indicate?
unsuccessful execution
What are the 2 versions of main?
int main() { … }
int main(int argc, char* argv[]) { … }
What is a C programming language?
A statically typed language where every variable must have a data type known without running the program.
What are data types?
A label which gives meaning to its stored in memory.
What do we control when choosing a specific data type?
The amount of memory we use, as different data types take up different amount of space.