#include <complex>
complex<double> max (complex <double> * array,int numberofelements)throw(std::string){
if (numberofelements < 1 || numberofelements > INT_MAX){
throw std::string ("Error too few values in max array");
}
complex <double> returncomp=array[0]
for (int i=0;i<functionlength;i++){
if (array[i].real()>returncomp.real()){
returncomp = (array[i].real,returncomp.imag);
}
if (array[i].imag()>returncomp.imag()){
returncomp = (returncomp.real,array[i].imag);
}
}
return returncomp;
}
Error- error: expected constructor, destructor, or type conversion before '<' token
This is particularly frustrating atm because I have tried all that I can think of as a fix. Complex has to have <double> or an equivalent type declared in the constructor. Also, I have built a function just like this elsewhere and received no errors.
Any advice would be amazing.
Also, if there are problems in certain parts of the code that are not the error (i.e. lack of ->) don't worry too much about it plz.