Test
GAME1001 Chapter 10
Este test tiene tiempo límite, así que se abre en el reproductor de siempre.
Preguntas del test (15)
1Each variable in a program is stored at a ________ location that has an ____________.
- Aoperator, address
- Bhexadecimal, operator
- Cunique, pointer
- Dunique, address
- Epointer, address
2What is a pointer variable?
- Aa variable that holds an address
- Ba variable that holds a value
- Ca variable that holds a memory location
- Dprovide an alternate way to access memory properties
- Eprovide an alternate way to access memory directives
3What will this program do?
int num = -23;
cout << #- Aprint the address in hexidecimal
- Bprint the address in a number
- Cprint the number
- Dnothing
- Ea condition that says (&& num)
4What is an indirection operator?
- Acan hold the address of an integer
- Bcan hold the address of a character
- Cthe spacing does not matter
- D*
- ENone of the above
5An _____ name is the starting _______ of the array
- Aarray, address
- Bprepocessor directive, address
- Carray, value
- Darray, pointer
- Epointer, array
6Array notation vals[i] is equivalent to the pointer notation ____________
- A*(vals + i)
- B(vals + i)
- C*(vals)
- D*
- Evals
7What will this statement print out?
int vals[ ] = { 4, 7, 11, 16, 24 };
int *valptr = vals;
cout << *(valptr + 2)- A11
- B4
- C7
- D16
- E0
8A pointer ___________ receives an address when a __________ is called.
- Aparameter, function
- Bsubscript, function
- Coperator, subscript
- Dparameter, element
- Eparameter, operator
9A constant pointer: the address in the pointer cannot be changed after the pointer is initialized.
- AVerdadero
- BFalso
10When will a pointer be 'dangling' ?
- AIf it contains the address of memory that has been freed by a call
- Bif no longer needed dynamic memory is not freed
- Cif the pointer was set to NULL or 0.
- DNone of the above
- EAll of the above
11What is a smart pointer?
- Aare objects that work like pointers
- Bare objects that work like deleted memory
- Care unique and shared
- Dare raw
12What is a unique pointer?
- Apoints to a dynamically allocated object
- Bcan be transferred to another pointer
- Cis deallocated when the unique pointer goes out of scope
- DNone of the above
13What does move ( ) do?
- Afunction is required on the arguement
- Bis not required for pass by reference
- Cused in unique pointers
- DAll of the above
14A shared pointer points to a dynamically allocated object
- AVerdadero
- BFalso
15References to a dynamic object are tracked in the same control block
- AVerdadero
- BFalso
Información
- Descripción
- Intro to Programming - GAME1001 Test sobre GAME1001 Chapter 10, creado por Liam Blake el 05/12/2018.
- Autor
- Liam Blake
- Idioma
- English
- Visitas
- 0
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test