Final study Flashcards

(46 cards)

1
Q

define a macro named MULT that multiplies a value by itself 3 times

A

define MULT(x) ((x)(x)(x))

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

.so

A

dynamic, runtime

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

volatile

A

can be modified outside the program

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

-O1 (Optimization flag)

A

compare multiple lines

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

Create a target in a Makefile called “wave” that checks if file1.c or file2.c changes

A

wave: file1.c file2.c

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

compile file1.o file2.o using the shared my_math library into “shared”

A

gcc file1.o file2.o -shared -o libmy_math.so

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

assign a new SDL_window pointer to window and name it “name” of size 4x7 in a 64 bit system

A

SDL_Window *window = SDL_CreateWindow( “name”, int w, int h, Uint64 flags);

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

clean: target in makefile

A

removes any build artifacts

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

”s” in -crvs

A

creates an index

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

“c” in -crvs

A

creates the archive

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

create a library using file1.o file2.o and libmy_math.a

A

ar -crvs libmy_math.a file1.o file2.o

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

-O3 (Optimization flag)

A

function inlining, loop unrolling

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

bt in gbt

A

back trace

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

extern

A

can be used through many modules

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

destroy an open window pointer named window

A

SDL_DestroyWindow(window);

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

-O2 (Optimization flag)

A

doesnt generate longer code

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

.a

A

static, executable

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

default target in a makefile

20
Q

assign a struct a function pointer called func that takes an int and string pointer and returns a double

A

double(*func)(int, char *);

21
Q

read 1 number from a binary file named rng into an int n

A

fread(&n, sizeof(int), 1, rng)

22
Q

3rd to be assigned in the stack

A

local variables

23
Q

-Ofast (Optimization flag)

A

optimize for speed

24
Q

how to link a library

A

-l<name></name>

25
const int *ptr;
the int cannot be modified
26
How do you search a specific librabry first
-L
27
4th to be assigned in the stack
arguments
28
const modifier
data should not be modified
29
1st to be assigned in the stack
return address
30
System calls
create, delete, sleep, wait, read, write
31
#undef
removes a definition
32
open a file pointer named rng that provides a random binary number when read
FILE *rng = fopen(“/dev/urandom”, “rb”);
33
-S
allows for reading in assembly
34
What is needed first to use graphics in C
bool SDL_Init(Uint32 flags);
35
#ifndef VAR
#if !defined(VAR)
36
int * const ptr;
the pointer cannot be modified
37
random()
provides a not so random random number
38
"r" in -crvs
inserts new files
39
srandom(time(0))
provides a random number
40
purpose of carnaries
protects the program from being corrupted
41
#ifdef VAR
#if defined(VAR)
42
bool SDL_PollEvent(SDL_Event *event);
grabs any event that happens and assigns it to the given variable
43
"v" in -crvs
shows progress
44
2nd to be assigned in the stack
frame pointer
45
.type
checks the event that occured
46
-l
flag for library