C Programming Flashcards

1
Q

When and by who was C developed?

A

By Dennis Ritchie, in 1969

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

What other languages has C influenced?

A

C++, D, Go, Rust, Java, JS

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

List some formats of C.

A
A middle level language
Free format 
Structured language
user defined types
Compact - 32 keywords
Portable
Efficient code
Complete control
C is case sensitive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does expr1 ? expr 2 : expr3 mean?

A

if(expr1)
expr2;
else expr3;

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

What is a pointer?

A

Pointer is a variable that contains the address of another memory location

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

What does #define do?

A

it is a preprocessor that is used to define constants and macros.
symbolic constants make the program more readable and are usually in upper case.

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

What does #include do?

A

substitutes the line with the contents of the file before the program is compiled

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

When is #include commonly used?

A

To include header files, which contain function prototypes, constant definitions, macro definitions and structure definitions.

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

What are numeric arrays?

A

Arrays are used to group together a large amount of data which is of the same data type and meaning.

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

What is a function?

A

A function is a unique code module created to perform a specific task.

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

What are some purposes and advantages of functions?

A
Structured software
Portability
Reduce size of code
Reduce debugging of code
Better way to debug programs
Code easily changed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are local variables?

A

Local variables are data objects of any type which are declared within a function

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

What are global variables?

A

Data objects that are declared outside of a function.

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

What are some basic types of variables?

A

Automatic and static

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

What is an automatic variable?

A

Variable who’s value can be changed

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

What are external variables?

A

External variables are used to reference global variables defined in another file

17
Q

List steps of modular program design

A
  1. Break problem into separate modules or units
  2. Each of these modules performs a specific task
  3. Each of these modules are going to accept info, process the info, and return useful data.
  4. The linking will solve the original problem.
18
Q

What are some benefits of modular program design?

A

To understand/manage the program

19
Q

What are three allowable types of pointer arithmetic?

A

Add integers to pointers
Subtract integers from pointers
Subtract pointers from pointers

20
Q

What does dynamic memory allocation do?

A

Allows to delay reserving of memory for a variable until during execution where the required amount can be optimally specified by the user or program.

21
Q

What is a structure?

A

A grouping of items of any type and size into a logical entity and single physical size

22
Q

What is a union?

A

Identical to structures, but all members of a union share the same storage space.