The error related to the title stems from this line:
cout<< "El arreglo invertido es:" << invertir(A,x) << endl;
The function invertir ()
returns void
, and can't be printed. To the compiler, that's like writing std:: cout <<;
, which is invalid. Change the return type of the function to one appropriate, or, simply don't try to print it. Call the function and allow it to print normally (since there's calls to std:: cout:: operator << ()
in the function).
You should attempt to interpret these errors that you get. Although the errors you get for such simple mistakes span pages (I got 194 lines of errors), changing just one line of code fixes it all. Don't be intimidated, check the line number you are given, and look around that code for simple mistakes.
My error looked like this, and a whole bunch more.
test92.cpp: In function ‘int main(int, char**)’:
test92.cpp:41:39: error: no match for ‘operator<<’
(operand types are ‘std::basic_ostream<char>’ and ‘void’)
That's all you need.