C prog

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

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

24 Terms

1
New cards

What does a C pointer store?

A memory address.

2
New cards

What does &x return?

The address of x.

3
New cards

What does *p mean in an expression?

The value or object at the address held by p.

4
New cards

What does int ***p declare?

A pointer to a pointer to a pointer to an integer.

5
New cards

How does pointer arithmetic scale?

p+i advances by i × sizeof(*p) bytes.

6
New cards

How are array indexing and pointer arithmetic related?

p[i] is equivalent to *(p+i).

7
New cards

What does *p++ do?

Uses the pointed-to value and advances the pointer.

8
New cards

What does (*p)++ do?

Increments the pointed-to value without changing the pointer.

9
New cards

What does *(++p) do?

Advances the pointer before dereferencing it.

10
New cards

Does C automatically check array bounds?

No.

11
New cards

What is NULL?

A null pointer value indicating that no object is pointed to.

12
New cards

How are arguments passed in C?

By value; passing pointers allows modification of pointed-to objects.

13
New cards

What does malloc do?

Allocates heap storage and returns a pointer or NULL on failure.

14
New cards

What does free do?

Releases dynamically allocated storage.

15
New cards

What is a memory leak?

Allocated memory is no longer needed but has not been released.

16
New cards

What is stored in the stack?

Function call information and typical automatic local variables.

17
New cards

What is stored in the heap?

Dynamically allocated data.

18
New cards

What is static storage?

Storage lasting throughout program execution.

19
New cards

What is a struct?

A composite data type grouping named fields.

20
New cards

What is typedef used for?

Creating an alias for a data type.

21
New cards

What does strlen count?

Characters before the terminating null byte.

22
New cards

What does strcmp return for equal strings?

0.

23
New cards

What does the linker do?

Combines object files and resolves references between compilation units.

24
New cards

What does the loader do?

Prepares an executable in memory for execution.