This bundle of errors is caused by one function, and none of these errors are valid
error C2059: syntax error : '=' error C2143: syntax error : missing ';' before '{' error C2181: illegal else without matching if error C2660: 'Lexicon::convertOntology' : function does not take 0 arguments
string Lexicon::convertOntology(string input, int d, string out, string temp) // C2059; C2143
{
if (in.length() == 0 && temp.length() == 0) {return out; //check for completed conversion //C2181
} else {
int r = 1;
if (d == 1) r = 0;
if (in[0] == '.' || in[0] == '-' || in == "") { //found deliminator or end //C2059; C2143
return convertOntology(in.substr(1), d, out+=vectorSearch(list, temp, 0, d, r), ""); //convert and check // C2143; C2660
} else return convertOntology(in.substr(1), d, out, temp); //increment and check
}
}
I did not place all the errors, they are repeated 14 times – it seems clear that these are not errors but is an issue with the compiler parsing the text; there is something upstream from this that is unmatched. I checked the previous function and checked the lines prior to where this function is called and found nothing.
How do I resolve these errors?
First of all, you reference
inthroughout your function although you pass a variable calledinput.Secondly, you should also check this
in[0] == '.' || in[0] == '-' || in == ""in another order, where you check for an empty string first. If the string is empty, your program will crash here when you try and access the first element[0]. Putin == ""first.Thirdly,
listisn’t defined anywhere I can see, and it’s being used here,vectorSearch(list, temp, 0, d, r), "");Finally, eww. Please don’t write c++ like that. IMHO there is nothing wrong with excusing brackets for one line if statements, but try and make everything readable so the next person doesn’t want to blow their brains out trying to figure out what’s going on.