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