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
|