Shared Flashcard Set

Details

Systems Terms: Pointers
Terms from Lecture 6 of my Systems class
13
Computer Science
Graduate
02/13/2025

Additional Computer Science Flashcards

 


 

Cards

Term
Why is a pointer always an integer?
Definition
A pointer is an address in memory, which is a hexadecimal number
Term
How to change a pointer's value (2)
Definition
1. Dereference it
2. Make it point somewhere else (with a double pointer)
Term
What is pointer decay?
Definition
An array is a pointer to its first element. When you pass an array as an argument, you lose its dimensions, so you can't use sizeof(). It will only pull the size of its first element.
Term
C-strings: integer
Definition
d
Term
Why does C have outputs as function inputs and use return to indicate errors? (2)
Definition
1. C does not have exceptions
2. Speed. Returning an output means making a copy of the output.
Term
errno
Definition
A global variable that contains the last error number
Term
perror()
Definition
Converts errno into words
perror("open")
open: No such file or directory
Term
How to deal with array/pointer decay (2)
Definition
1. Pass the size of the array into the function as an argument
2. Put an identifier at the end of the array so we know where it ends as we iterate through
Term
C-strings: long integer
Definition
ld
Term
C-strings: pointer
Definition
p
Term
C-strings: string
Definition
s
Term
C-strings: size
Definition
zd
Term
C-strings: unsigned integer
Definition
zu
Supporting users have an ad free experience!