c++ oop | Sololearn: Learn to code for FREE!


c++ oop

how do i add two array of object with operator overloading so that i can output all the element Example: a3 = a1 + a2;

3/12/2021 9:42:42 AM


1 Answer

New Answer


I'm not sure I understand what you are trying to achieve. Do you want to concatenate two arrays via an overloaded + operator? Why not just use std::vector? With plain arrays, passing the size would be problematic. Or are the arrays property of the object and you want to create a new object with the arrays merged together? It would be helpful if you could give some more information in this regards, maybe post a sample code; the example doesn't really convey a lot. Is the question perhaps related to the Queue Management Part 2 project from the C++ course?