Pointers Flashcards
What happens when we declare a variable in C?
Variable will be assigned to a certain memory address
An addressable memory cell can store up to _ byte/s
one
A variable will be assigned only to a _____________
free memory cell
A value that we get when we access a variable that is not initialized
garbage value
Contains the address of another variable
Pointers
Pointer Syntax
<dataType> *<ptrName>
</ptrName></dataType>
Returns the address of the variable
Address Operator (&)
AKA dereferencing
Refers to the memory cell whose address is specified by the pointer variable
Indirection Operator (*)
Pointer variable that points to another pointer
Pointer to a pointer
Pointer to a pointer syntax
<dataType> **<ptrName>
</ptrName></dataType>
____________ define what value a pointer to a pointer can hold
num of asterisks
Usually, the most number of asterisks used is only ___
two
A pointer P, can hold the address of a variable Q if:
- P and Q have the same data type
- Q has one less asterisk than P
Maximum number of indirection operators (*) that can be used in the pointer is ________
same # as its declared #
Referencing an uninitialized pointer may result to a __________
segmentation fault error