Midterm Review - CSCI 1730

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:46 AM on 10/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

43 Terms

1
New cards

how do you know if a line in your source code is a preprocessor directive?

begins with a "#"

ex. #include

2
New cards

what does "compile" do?

turn the source code to an object code

3
New cards

what does "link" do?

turn the object code to an executable

4
New cards

what are the format specifiers?

begin with % and are used as placeholders to define the format and type of data to be printed

5
New cards

format specifier to print base 10 signed int

%d

6
New cards

format specifier to print base 10 unsigned int

%u

7
New cards

format specifier to print floating point values

%f

8
New cards

format specifier to print pointers

%p

9
New cards

format specifier to print hexadecimals

%x

10
New cards

format specifier to print characters

%c

11
New cards

format specifier to print strings

%s

12
New cards

valid names for a makefile

makefile

Makefile

13
New cards

default target

first target defined in the makefile

14
New cards

how can target dependencies be specified?

after the target name and the colon(:), specify a list of space-seperated dependencies

15
New cards

how are strings represented in C

data type is just an array of characters

16
New cards

diff b/w array and array of char

array of char to quaify as a string in C, the special null charcter (\0) must be the last charcter

17
New cards

diff b/w array and array of char

null character is used to indicate the end of the string

18
New cards

declare a pointer

19
New cards

how to obtain the memory of address of variable?

-use the "address of" operator &

-ptr = &x;

20
New cards

how do you retrieve the data value that a pointer points to? how do you update the data value using that pointer?

- use dereference operator*

- int y = *ptr;

- *ptr = 10

21
New cards

6 phases of a C program

1. editing in the editor

2. preprocess - processes the code

3. compile - compiler created the object file and stores it in the dicks

4. link - where executable files are created from object

5. load - where the code is put into a memory disk by the loader

6. execute: where the code is run and executed

22
New cards

compile and linking a c program

use command $ gcc -o filename filename.c

23
New cards

running a c program

use command $ ./filename

24
New cards

make utility

make is used in c and is incorporated in makefile

25
New cards

makefiles with variables

adding variables makes it very useful for multiple files

26
New cards

-Wall -pedantic-error flags

catch potential bugs with code

27
New cards

fundamental data types

char, int, float, double

28
New cards

data types modifiers that can combine with earlier types

signed, unsigned, short, long

29
New cards

signed

ability to look at negative numbers

0(+)

1(-)

30
New cards

char size

1 byte

31
New cards

unsigned char

8 zeros

32
New cards

sizeOf()

to check the size

33
New cards

& bitwise

compares each bit and does AND

34
New cards

| bitwise

compare each bit and does OR

35
New cards

^ bitwise

compares each bit and does XOR

36
New cards

~ bitwise

NOT

bits are flipped

37
New cards

<< left shift

shifts bits to left

38
New cards

>> right shift

shifts bits to the right

39
New cards

bitwise operators

- manipulate individual bits within a variable

- helps use less memory

40
New cards

arrays

Series of elements of the same type placed adjacently and can be referenced by indexes in a unique identifier

41
New cards

arrow operator

dereference operator which can be used with pointers to structs and can direct access the members

42
New cards

stack

used for mainly static memory location

43
New cards

heap

is used for dynamic memory allocation for storing objects and data structures that require a longer life