Hello guys. I am writing sequential search programm, i am not finished yet but already have error while trying to compile, what's the problem? Thank you very very very much for your help!!!!!!! =)
error:
In function 'seqSearch'
syntax error before ')' token
it is in first for loop
Code:int seqSearch(int list[], int last, int target, int locat){ int search; int numOfsearch=0; int found=0; for(search =0; search < last && target != list[search]) search++; locat = search; if(target == list[search]) found = 1; else{ numOfsearch= search+1; } printf("\n %d \n", numOfsearch); return found; } int main() { int n=100; int list[n]; int last = n-1; int target; int locat=0; int found=0; printf(" Please enter number that you whant to search for:\n"); scanf("%d\n", &target); arrayfill(list, last); found=segSearch(list, last, target, locat); system("PAUSE"); return 0; }