C++ Vector operator=()
This function assigns new values to the vector container and replacing old ones.
Consider two vectors 'v' and 'v1'. Syntax would be :
Here, the values of v1 vector are assigned to the vector v2.
v1:v1 is a vector object.
It returns *this.
Let's see a simple example.
In this example, values of v vector are assigned to the vector v1 using operator= () function.
Let's see a another simple example.
In this example, values of v vector are assigned to the vector v1 using operator=() function and replacing the old contents.
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