1 - Intro Lecture Flashcards

1
Q

Is C an object oriented or function oriented language?

A

Function oriented

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

Does C have polymorphism?

A

Yes, but only in a very limited fashion e.g. integer to float

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

How is memory managed in a C program?

A

Manually with function calls e.g. malloc

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

How is concurrency managed in C?

A

Only through library functions

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

Does C have support for exceptions and exception handling?

A

No

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

How can you find the length of an array in C?

A

You can’t. You need to keep track of its length yourself

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

Does C have a string data type?

A

Not without installing a library. Strings are just an array of chars terminated with a /0

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

What is the name of the starting function in a C program?

A

main()

This is started when the executable is run by the user

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

include

What does the following C code do?:

A

Imports the standard input/output header to allow access to basic input and output functions

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

What are the two main C compilers for Unix?

A

gcc and clang

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

What does the following compiler option do?

-Wall

A

Shows all warnings

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

What does the following compiler option do?

-Wextra

A

Shows extra warnings

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

What does the following compiler option do?

-g

A

Adds debugging information

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

What does the following compiler option do?

-o

A

Name the executable

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

What does the following compiler option do?

-O -O2 -O3

A

Optimise (more and more)

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