What are the two member functions of each Standard Template

What are the two member functions of each Standard Template Library (STL) container that returns iterators (one points to the first element of the container, another points to an imaginary element just beyond the last element of the container)?

Select one or more:

a. clear()

b. end()

c. assign(p, q) where p and q are iterators

d. begin()

Solution

b. end()

d. begin()

end() function returns an iterator which points to an imaginary element just beyond the last element of the container.

begin() function returns an iterator which points to the first element of the container.

clear() function erases all the contents of the container

assign(p,q) assigns new contents to the container replacing its current contents, and modifying its size .

What are the two member functions of each Standard Template Library (STL) container that returns iterators (one points to the first element of the container, an

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site