1 - Intro Lecture Flashcards
Is C an object oriented or function oriented language?
Function oriented
Does C have polymorphism?
Yes, but only in a very limited fashion e.g. integer to float
How is memory managed in a C program?
Manually with function calls e.g. malloc
How is concurrency managed in C?
Only through library functions
Does C have support for exceptions and exception handling?
No
How can you find the length of an array in C?
You can’t. You need to keep track of its length yourself
Does C have a string data type?
Not without installing a library. Strings are just an array of chars terminated with a /0
What is the name of the starting function in a C program?
main()
This is started when the executable is run by the user
include
What does the following C code do?:
Imports the standard input/output header to allow access to basic input and output functions
What are the two main C compilers for Unix?
gcc and clang
What does the following compiler option do?
-Wall
Shows all warnings
What does the following compiler option do?
-Wextra
Shows extra warnings
What does the following compiler option do?
-g
Adds debugging information
What does the following compiler option do?
-o
Name the executable
What does the following compiler option do?
-O -O2 -O3
Optimise (more and more)