vector_set_get#

View page source

Setting and Getting Vector Elements#

Syntax#

u [ i ] = x
y = v [ i ]

element_type#

We use element_type to denote the type of elements in the vector. It must be one of the following types: bool , int , double , a_double .

i#

This argument has c++ prototype

      size_t i

It must be between zero and the size of the vector minus one.

u#

The object u has c++ prototype

      vec_element_type& u

x#

The argument x has c++ prototype

      const element_type& x

v#

The object v has c++ prototype

      const vec_element_type& v

y#

The result y has c++ prototype

      element_type y

Example#

c++, python.