Cplusplus Programming Seq Con Vector Class 1 Online Exam Quiz

Cplusplus Programming Seq Con Vector Class 1 GK Quiz. Question and Answers related to Cplusplus Programming Seq Con Vector Class 1. MCQ (Multiple Choice Questions with answers about Cplusplus Programming Seq Con Vector Class 1

Which of the following header file is needed to use vectors in your program?

Options

A : <array>

B : <vector>

C : <containers>

D : <stdio>

View Answer

What are the vectors?

Options

A : Arrays with dynamic size

B : Arrays with different types of elements

C : Same as array classes

D : Arrays with static size but use template classes

View Answer

What is the difference between begin() and cbegin() in vectors?

Options

A : both are same

B : begin() returns iterator to first element and cbegin() returns iterator to last element

C : begin() returns an iterator to first element whereas cbegin() returns constant iterator to first element

D : begin() returns returns first element cbegin() returns void

View Answer

What is the difference between begin() and rbegin()?

Options

A : both are the same

B : begin() returns an iterator to the first element and rbegin() returns an iterator to an element kept at the end of the vector

C : begin() returns an iterator to first element whereas rbegin() returns constant iterator to first element

D : begin() returns returns first element rbegin() returns void

View Answer

Which of the following(s) can be used to access the first element of a vector v?

Options

A : v.begin()

B : v.cbegin()

C : v[0]

D : all of the mentioned

View Answer

Which of the following(s) can be used to access the last element of a vector v?

Options

A : v.end()

B : v.cend()

C : both v.end() and v.cend()

D : vectors do not have a function to access the last element

View Answer

Which of the following function is used to get the actual number of elements stored in vector?

Options

A : v.size()

B : v.capacity()

C : v.max_size()

D : v.no_of_elements()

View Answer

Which function is used to get the total capacity of a vector?

Options

A : v.size()

B : v.capacity()

C : v.max_size()

D : v.no_of_elements()

View Answer

Which is the following is syntactically correct for vector<int> v?

Options

A : vector <int> :: const_iterator itr = v.rbegin();

B : vector <int> :: reverse_iterator itr = v.begin();

C : vector <int> :: iterator itr = v.begin();

D : vector <int> :: iterator itr = v.cbegin();

View Answer

How the size of a vector increases once it is full?

Options

A : Vector increases its capacity one by one

B : Vector doubles its capacity after it is full

C : Vector increases its capacity by half of its previous size

D : Vector increases its capacity by a constant factor

View Answer

Chemical Engineering Basics - Part 1 more Online Exam Quiz

Cplusplus Programming Questions And Answers Stored Sequences

Cplusplus Programming References 2

Cplusplus Programming References 3

Cplusplus Programming Seq Con Array Class 1

Cplusplus Programming Seq Con List

Cplusplus Programming Seq Con Vector Class 2

Cplusplus Programming Standard Template Library

Cplusplus Programming Static Constant Keyword

Cplusplus Programming Stl Algorithms

Cplusplus Programming Stl Container Any 1