I keep getting the following error:
"cannot convert 'std::string' to 'int' for argument '1' to 'int linearSearch(int, int*, int)'".
Basically my main arrays consists of:
string studentID[] = {"P1001", P"1002"}
int studentMark[] = {78.50, 66}
I am trying to allow the user to search for a given studentID, and the output will display the correponding marks for it. I am trying to use linear search (not sure if Im doing it right or not)
Your function takes 'int's, and you're giving it strings and floats. Strings and floats are not ints, and therefore you're getting errors. Either change the function to take strings and floats, or convert your strings and floats to ints. It's hard to say which approach is preferable without seeing the function in question -- but I'd guess the former.