50.8k views
1 vote
The statement ____ declares intList to be a vector and the component type to be int

A.
vector intList;

B.
int.vector intList;

C.
int.vector intList;

User Pinaki
by
7.6k points

1 Answer

2 votes

Answer: vector<int> intList

Step-by-step explanation:

Using the above declaration we can declare intList to be a vector and the component type to be int.

example:

int main()

{

vector<int> intList

intList.push_back(1);

intList.push_back(2);

intList.push_back(3);

printList(intList); // printing the list

}

User Darian Everett
by
8.2k points