this works, however I need to also cout an array that is from my driver. When I did this without operator overloading I simply passed the array from driver to the function as a parameter like so:
I don't think it is a good idea to pass an array by value to a function (even if custom one).
The problem of managing an "undefined size" array is that your class cannot control the actual size of the array and if element [x] exists or not.
So it would be better to pass a std::string (if it an array of character) or a std::vector (if it is an array of data).
The syntax would be (taking an example of vector of integers)
Thank you so much for replying, but I just have a question regarding your answer. I already made the array for my program, it has a defined size of 10 and it is filled with values. The only way for my program to work is for me to use this array with the operator<< function. can I do the same thing you suggested with vectors with an array?
This is a program for my class and my professor requires that we do not use vectors yet. thank you again for your help.