Prrogram C (Exam 3)

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

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:49 AM on 4/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

22 Terms

1
New cards

Strings: The “Null” Terminator

Is a special character used in C to mark the end of a string.

2
New cards

C strings are NOT their own (BLANK); they are just (BLANK) of (BLANK).

data type; array; characters.

3
New cards

Without the (BLANK) functions like (BLANK) or (BLANK) would not know where the string (BLANK), leading to (BLANK)

null terminator (‘\0’); printf; strlen; ends or “stops”; undefined behavior or “garbage” behavior — program crashes

4
New cards

A (BLANK) is a variable that stores the (BLANK) of another variable rather than a (BLANK)

Pointer; memory address; direct value

5
New cards

Dereferencing

Using the asterisk (*) operator to access or modify the value stored at the address the pointer is holding

6
New cards

Address-of Operator

Using the ampersand (&) to retrieve the memory address of a standard variable

7
New cards

Stack Memory

Memory managed automatically by the complier. It stores local variables and functions calls. It is fast but small and fixed in size.

8
New cards

Heap Memory

Memory managed manually by the programmer using malloc or calloc. It is much larger and flexible but slower to access.

9
New cards

Memory Leak

A condition where a program allocates memory on the heap but fails to free() it before the pointer is lost, wasting system resources

10
New cards

Pass by Reference

A method of passing arguments to a function where the address of the variable is passed instead of a copy of its value.

11
New cards

True or false; pass by reference allows a function to modify the original variable's value in the calling function (like main).

True

12
New cards

A (BLANK) is a (BLANK) that allows you to group variables of a different types (heterogenous data) under a single name.

Struct(structure); user-defined data type;

13
New cards

True or False; Like an Array (which holds the same type of data), a struct can not hold a char, an int, and a float all at once.

False

14
New cards

argc (Argument count)

An integer representing the number of arguments passed to the program from the command line (including the program name itself)

15
New cards

argv (Argument rector)

An array of strings (pointers to characters) where each string is one of the arguments passed

16
New cards

Calloc

Allocates memory and initializes all bytes to zero.

17
New cards

Malloc

Allocates a block of uninitialized memory (contains “garbage” values).

18
New cards

The FILE Pointer

FILE * is a specific data type (a structure) used by C to keep track of a file’s “state” (where you are currently reading or writing in that file)

19
New cards

Opens an existing file. Crucial: If the file does not exist, fopen returns null

mode “r” (Read)

20
New cards

Creates a new file. Crucial: If the file already exists, it contents are overwritten (deleted) immediately

mode “w” (write)

21
New cards

A definition for a special constant that signals when there is no more data to read from a file

EOF (End of File)

22
New cards