1. Which statement displays the address of the variable num1? a) cout << num1; b
ID: 3570768 • Letter: 1
Question
1. Which statement displays the address of the variable num1?
a) cout << num1;
b) cout << *num1;
c) cin >> &num1;
d) cout <<&num1;
e) none of these
2. The following statement:
cin >> *num3;
a) stores the keyboard input into the variable num3
b) stores the keyboard input into the pointer called num3
c) is illegal in C++
d) stores the keyboard input into the variable pointed to by num3
e) none of these
3. If a variable uses more than one byte of memory, for pointer purposes its address is ____.
a) the address of the lasy byte of storage
b) the average of the addresses used to store the variable
c) the address of the first byte of storage
d) general delivery
e) none of these
4. The following statement:
int *ptr = new int;
a) results in a compiler error
b) assigns an integer less than 32767 to the variable named ptr
c) assigns an address to the variable named ptr
d) creates a new pointer named int
e) none of these
5. True or false?
To use any of the smart pointers in C++11, you must #include the memory header fie with the following directive:
#incude <memory>
a) true
b) false
Explanation / Answer
1.d) cout <<&num1;
2.d) stores the keyboard input into the variable pointed to by num3
3.c) the address of the first byte of storage
4.c) assigns an address to the variable named ptr
5.False
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.