C++ Vector at()
It gives a reference to an element.
Consider a vector v and k is the position. Syntax would be:
k: k defines the position of element which is to be returned by at() function.
It returns the element of specified position.
The following illustration shows how at() function works
If i=0 :
If i=3 :
Let's see a simple example.
In this example, at() function access the elements of vector .
Next TopicC++ Vector
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week