Deck 10: Pointers

ملء الشاشة (f)
exit full mode
سؤال
The C++ operator * means the address of .
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The asterisk ( * ) symbol is also called the ____ operator.

A) pointer
B) reference
C) increment
D) dereferencing
سؤال
The address named as a reference can be altered.
سؤال
References are used almost exclusively as formal function parameters and ____ types.

A) object
B) class
C) return
D) constant
سؤال
As each variable is defined in a program, sufficient storage for it is assigned from a pool of computer memory locations made available to the compiler.
سؤال
To use a stored address, C++ provides us with an indirection operator, ____.

A) &
B)
C) *
D) %
سؤال
For each array created, the array name becomes the name of the pointer constant the compiler creates for the array.
سؤال
____ are simply variables used to store memory addresses.

A) Pointers
B) Objects
C) Arrays
D) Vectors
سؤال
Essentially, a(n) ____ is a named constant for an address.

A) pointer
B) reference
C) class
D) indirection
سؤال
When used in declaring reference arguments, the ampersand refers to the data type preceding it.
سؤال
Technically, references are said to be ____.

A) explicitly dereferenced
B) statically dereferenced
C) manually dereferenced
D) automatically dereferenced
سؤال
If a character s address is stored in a pointer, only ____ byte(s) of storage would be retrieved when the address is used.

A) one
B) two
C) four
D) six
سؤال
The delete operator alters the address passed to it.
سؤال
Reference variables are available in C++.
سؤال
A(n) ____ error is produced when an attempt is made to equate a reference to a constant.

A) logic
B) compiler
C) codec
D) executable
سؤال
If the integer s address is stored in a pointer, typically only ____ bytes of storage are retrieved when the address is used.

A) two
B) three
C) four
D) eight
سؤال
Addresses cannot be incremented or decremented.
سؤال
Multiple references cannot be declared in a single statement.
سؤال
To display the address of a variable, you can use C++ s address operator, ____.

A) >>
B) ^
C) ::
D) &
سؤال
The use of a pointer requires the computer to do a double lookup.
سؤال
Pointers must be ____________________ before they can be used to store an address.
سؤال
The C++ ____ operator releases a block of bytes reserved previously.

A) free
B) delete
C) return
D) dealloc
سؤال
The ____ consists of unallocated memory that can be allocated to a program, as requested, while the program is running.

A) pool
B) queue
C) heap
D) stack
سؤال
Pointers to functions are possible because function ____ are themselves pointer constants.

A) classes
B) methods
C) names
D) values
سؤال
Assuming ptNum is a pointer, the statement ____ uses the pointer and then increments it.

A) *++ptNum
B) *ptNum++
C) *ptNum--
D) *--ptNum
سؤال
In contrast to implicitly passing addresses with ____, addresses can be explicitly passed using pointers.

A) extern variables
B) instances
C) static variables
D) references
سؤال
A double typically requires the retrieval of ____________________ bytes of storage.
سؤال
Any address returned by ____ can be used subsequently by ____ to restore reserved memory back to the computer

A) new , delete
B) delete , new
C) * , reset
D) peek , poke
سؤال
There is a direct relationship between array names and ____________________data types.
سؤال
The compiler automatically converts any array subscript used by a programmer to an equivalent ____ expression.

A) reference
B) pointer
C) class
D) object
سؤال
The term ____ describes the condition that occurs when dynamically allocated memory isn t returned explicitly by using the delete operator and the operating system doesn t reclaim allocated memory.

A) stack leak
B) heap leak
C) garbage collection
D) memory leak
سؤال
The 1 in the expression *(gPtr + 1) is a(n) ____.

A) pointer
B) initializer
C) offset
D) register
سؤال
Under a ____ allocation scheme, the amount of storage to be allocated is determined and adjusted at runtime rather than compile time.

A) fixed
B) predefined
C) dynamic
D) static
سؤال
When constructing references, the reference should be of the same data type as the ____________________ to which it refers.
سؤال
A pointer reference can always be replaced with a ____ reference.

A) variable
B) constant
C) class
D) subscript
سؤال
The advantage of using references over using pointers is that the notation is ____.

A) more thorough
B) simpler
C) faster at runtime
D) written in a lower-level language
سؤال
When an array is created, the compiler creates an internal point constant for it automatically and stores the array s ____ in this pointer.

A) length
B) number of elements
C) starting address
D) name
سؤال
When used in a nondeclarative statement, the operator placed in front of a variable s name refers to the ____________________ of the variable.
سؤال
Explicitly passing addresses with the address operator is referred to as a pass by ____.

A) reference
B) value
C) copy
D) image
سؤال
A computer uses an array s ____ to calculate the array element s address based on both the array s starting address and the amount of storage each element uses.

A) subscript
B) reference
C) length
D) operand
سؤال
The ____________________ statement restores an allocated block of storage back to the free storage area (the heap) while a program is running.
سؤال
The 1 in the expression *(gPtr + 1) is a(n) ____________________.
سؤال
For each array created, the array name becomes the name of the pointer ____________________ the compiler creates for the array.
سؤال
____________________ allocation of memory is useful when dealing with lists because it allows expanding the list as new items are added and contracting the list as items are deleted.
سؤال
Expressions taking the address of an array name are invalid because the pointer the compiler creates is ____________________ to the computer.
سؤال
The compiler automatically converts any subscript used by a programmer to an equivalent ____________________ expression.
سؤال
Like all variables, pointers can be initialized when they are ____________________.
سؤال
The addresses in pointers can be compared by using any of the C++ ____________________ operators.
سؤال
The advantage of using pointers rather than references is that the function call specifies that ____________________ are being used.
سؤال
Access to multidimensional ____________________ can be made using pointer notation.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 10: Pointers
1
The C++ operator * means the address of .
False
2
The asterisk ( * ) symbol is also called the ____ operator.

A) pointer
B) reference
C) increment
D) dereferencing
D
3
The address named as a reference can be altered.
False
4
References are used almost exclusively as formal function parameters and ____ types.

A) object
B) class
C) return
D) constant
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
As each variable is defined in a program, sufficient storage for it is assigned from a pool of computer memory locations made available to the compiler.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
To use a stored address, C++ provides us with an indirection operator, ____.

A) &
B)
C) *
D) %
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
For each array created, the array name becomes the name of the pointer constant the compiler creates for the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
____ are simply variables used to store memory addresses.

A) Pointers
B) Objects
C) Arrays
D) Vectors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
Essentially, a(n) ____ is a named constant for an address.

A) pointer
B) reference
C) class
D) indirection
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
When used in declaring reference arguments, the ampersand refers to the data type preceding it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
Technically, references are said to be ____.

A) explicitly dereferenced
B) statically dereferenced
C) manually dereferenced
D) automatically dereferenced
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
If a character s address is stored in a pointer, only ____ byte(s) of storage would be retrieved when the address is used.

A) one
B) two
C) four
D) six
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
The delete operator alters the address passed to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
Reference variables are available in C++.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
A(n) ____ error is produced when an attempt is made to equate a reference to a constant.

A) logic
B) compiler
C) codec
D) executable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
If the integer s address is stored in a pointer, typically only ____ bytes of storage are retrieved when the address is used.

A) two
B) three
C) four
D) eight
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
Addresses cannot be incremented or decremented.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
Multiple references cannot be declared in a single statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
To display the address of a variable, you can use C++ s address operator, ____.

A) >>
B) ^
C) ::
D) &
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
The use of a pointer requires the computer to do a double lookup.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Pointers must be ____________________ before they can be used to store an address.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
The C++ ____ operator releases a block of bytes reserved previously.

A) free
B) delete
C) return
D) dealloc
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
The ____ consists of unallocated memory that can be allocated to a program, as requested, while the program is running.

A) pool
B) queue
C) heap
D) stack
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Pointers to functions are possible because function ____ are themselves pointer constants.

A) classes
B) methods
C) names
D) values
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
Assuming ptNum is a pointer, the statement ____ uses the pointer and then increments it.

A) *++ptNum
B) *ptNum++
C) *ptNum--
D) *--ptNum
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
In contrast to implicitly passing addresses with ____, addresses can be explicitly passed using pointers.

A) extern variables
B) instances
C) static variables
D) references
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
A double typically requires the retrieval of ____________________ bytes of storage.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
Any address returned by ____ can be used subsequently by ____ to restore reserved memory back to the computer

A) new , delete
B) delete , new
C) * , reset
D) peek , poke
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
There is a direct relationship between array names and ____________________data types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
The compiler automatically converts any array subscript used by a programmer to an equivalent ____ expression.

A) reference
B) pointer
C) class
D) object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
The term ____ describes the condition that occurs when dynamically allocated memory isn t returned explicitly by using the delete operator and the operating system doesn t reclaim allocated memory.

A) stack leak
B) heap leak
C) garbage collection
D) memory leak
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
The 1 in the expression *(gPtr + 1) is a(n) ____.

A) pointer
B) initializer
C) offset
D) register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
Under a ____ allocation scheme, the amount of storage to be allocated is determined and adjusted at runtime rather than compile time.

A) fixed
B) predefined
C) dynamic
D) static
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
When constructing references, the reference should be of the same data type as the ____________________ to which it refers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
A pointer reference can always be replaced with a ____ reference.

A) variable
B) constant
C) class
D) subscript
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
The advantage of using references over using pointers is that the notation is ____.

A) more thorough
B) simpler
C) faster at runtime
D) written in a lower-level language
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
When an array is created, the compiler creates an internal point constant for it automatically and stores the array s ____ in this pointer.

A) length
B) number of elements
C) starting address
D) name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
When used in a nondeclarative statement, the operator placed in front of a variable s name refers to the ____________________ of the variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Explicitly passing addresses with the address operator is referred to as a pass by ____.

A) reference
B) value
C) copy
D) image
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
A computer uses an array s ____ to calculate the array element s address based on both the array s starting address and the amount of storage each element uses.

A) subscript
B) reference
C) length
D) operand
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
The ____________________ statement restores an allocated block of storage back to the free storage area (the heap) while a program is running.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
The 1 in the expression *(gPtr + 1) is a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
For each array created, the array name becomes the name of the pointer ____________________ the compiler creates for the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
____________________ allocation of memory is useful when dealing with lists because it allows expanding the list as new items are added and contracting the list as items are deleted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
Expressions taking the address of an array name are invalid because the pointer the compiler creates is ____________________ to the computer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
The compiler automatically converts any subscript used by a programmer to an equivalent ____________________ expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
Like all variables, pointers can be initialized when they are ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
The addresses in pointers can be compared by using any of the C++ ____________________ operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
The advantage of using pointers rather than references is that the function call specifies that ____________________ are being used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
Access to multidimensional ____________________ can be made using pointer notation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.