C2: Introduction to C Flashcards

1
Q

What does hosted implementation of C mean?

A

It means full support for standard libraries. this type of C is used on top of OS.

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

What is a freestanding implementation of C?

A

It means there is restricted library support. This is the case usually when C is run on hardware. ex: embedded systems

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

Why include a header file in a C program?

A

to use standard libraries

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

What are the steps for building C programs?

A

preprocessing, compiling, linking. (Using gcc usually executes all three steps automatically.)
in console:
>gcc -o hello hello.c
>./hello

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

What is pre-processing?

A

 Pre-processing: processing directives,

modifying source file text

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

What is compiling?

A
 Compiling: translating source code into
machine instructions (object code)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is linking?

A

 Linking: combining object code created
by compiler with other code to create a
single executable program

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

What are comments?

A

They are text for documentation purposes and are mapped to whitespaces before preprocessing. (Neither pre-processor nor compiler sees them.)

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

What is a variable

A

it has a name, a type and a value. It can be assigned values, do calculations and in-/output variables

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

What is a function?

A
They are the basic means to avoid code
duplication and to structure our program
 Cannot be nested, grouped, etc.
 main is a special function and the only
mandatory one
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are control structures in C?

A
Two types:
 Selection
• if statement
• switch statement
 Loops
• while loop
• do while loop
• for loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly