COP 1220 Chapter 7
The unary * and ___________________ are complements of one another.
&
the ___________ or address operator, is a unary operator that returns the address of it's operand.
&
is bPtr is assigned b (the name of an array), then array element b[3] can alternatively be reference with the pointer expression ________________ .
b[bPtr + 3]
Pointers may be assigned to which of the following?
both address and null
an expression such as sizeof(arrayName)/ sizeof(double) might tipically be used to determine
the number of elements in an array
Comparing pointers and performing arithmetic on them is meaningless unless
they point to members of the same array
when calling a function with argument that should be modified, the ________________ of those arguments are passed.
values
if array name arrayName is passed to a function, C automatically passes _____________.
&arrayName[0]
which of the following can have a pointer as an operand?
++
the statement y = &yPtr;
assigns the address to y
Pointers cannot be used to
find the variable memory
The highest level of data access is granted by a
non constant pointer to non constant data
Sizeof
returns the total number array
which of the following gives the number of elements in the array int r[]?
sizeof (r) / sizeof (int)
Assuming that t is an array and tPtr is a pointer to that array, what expression refers to the address of element 3?
*(t +3)
Given that k is an interger array starting at location 2000, kPtr is a pointer to k, and each interger is stored in 4 bytes of memory, what location does kPtr + 3 point to?
2012
What method should be used to pass an array to a function that does not modify the array and only looks at it using array subscript notation?
a constant pointer and constant data
A pointer cannot be assigned to
cast operator
The leas access privilege is granted by a _________ pointer to ___________ data
constant, constant
the & operator can be applied to
constants
Referencing a value through a pointer is called __________.
indirection
when compiler encounters a function parameter for a single-subscripted array of the form int a;', it converts parameter to
int * a
The definition in *count;
is a correct definition
A string array
is always less memory efficient that an equivalent double-subscripted array
Pointers are variables that contain ____________ as their values.
memory addresses
A function that modifies an array by using pointer arithmetic to process every value should have a parameter that is?
non constant pointer and non constant data
A function that prints a string should have a parameter that's a
nonconstant pointer to constant data
when a structure must be passed to a function, we can use pointers to constant data to get the performance of a call by _________________ and the protection of a call by _________________.
reference value
A non-pointer variable name __________ references a value and a pointer variable name ___________ references a value.
directly, indirectly