C++ Vector at()It gives a reference to an element. SyntaxConsider a vector v and k is the position. Syntax would be: Parameterk: k defines the position of element which is to be returned by at() function. Return valueIt returns the element of specified position. The following illustration shows how at() function worksIf i=0 : ![]() If i=3 : ![]() ExampleLet's see a simple example. Output: 1234 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