Deck 10: Pointers
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
العب
ملء الشاشة (f)
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
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
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) %
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
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
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
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
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
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
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) &
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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