1. What does the following statement do? vector<int> v(10); A) It creates a vect
ID: 3570730 • Letter: 1
Question
1. What does the following statement do?
vector<int> v(10);
A) It creates a vector object and initializes all of its elements to the value 10.
B) It creates a vector object with a starting size of 10.
C) It creates a vector object and initializes the first element with the value of 10.
D) It creates a vector object that can store only values of 10 or less.
2. The contents of pointer variables may be changed with mathematical statments that perform ____.
A) All mathematical operations that are legal in C++
B) multiplication and division
C) addition and subtraction
D) B and C
E) None of these
3. In C++11, the ____ key word was introduced to represent the address 0.
A) nullptr
B) NULL
C) weak_ptr
D) All of these
E) None of these
4. What will the following statement output?
cout << &num1;
a. The value stored in the variable called num1.
b. The memory address of the variable called num1.
c. The number 1.
d. The string "&num1".
e. None of these
5. Look at the following statement:
int *ptr = nullptr;
In this statement, what does the word int mean?
A) The variable named *ptr will store an integer value.
B) The variabe named *ptr will store an asterik and an integer value.
C) ptr is pointer variable that will store the address of an integer variable
D) all of these
E) none of these
Explanation / Answer
Here are the answers:-
Q1 A) It creates a vector object and initializes all of its elements to the value 10.
Q2 D) B and C
Q3 A) nullptr
Q4 b. The memory address of the variable called num1.
Q5 C) ptr is pointer variable that will store the address of an integer variable
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.