a) v.begin()
b) v.cbegin()
c) v[0]
d) all of the mentioned
1 thought on “Which of the following(s) can be used to access the first element of a vector v?”
Leave a Comment
You must be logged in to post a comment.
a) v.begin()
b) v.cbegin()
c) v[0]
d) all of the mentioned
You must be logged in to post a comment.
d
Explanation: To access the first element of a vector we can use the following things:
i) v.begin()
ii) v.cbegin()
iii) v[0]
iv) v.at(0)