Tworzę sobie funkcje inttersearch
int __fastcall interseach(Pointer Parameter)
{
double w=5;
int sec=30;
if(tab==NULL || n==0)
return -1;
int ip = 0,ik = n-1;
if(tab[ip]==tab[ik])
{
if(tab[ip]==w)
{
Sleep(sec);
shape[ip]->Brush->Color=clLime;
return ip;
}
else return -1;
}
while((tab[ip] <= w) && (w <= tab[ik]))
{
int is = ip + (w - tab[ip]) * (ik - ip) / (tab[ik] - tab[ip]);
if(w==tab[is])
{
Sleep(sec);
shape[is]->Brush->Color=clLime;
shape[is]->Repaint();
return is;
}
else if(w>tab[is]) ip=is+1; else ik =is-1;
Sleep(sec);
shape[is]->Brush->Color=clRed;
shape[is]->Repaint();
}
return -1;
ExitThread(GetExitCodeThread(interseach, NULL));
}
W_ID = BeginThread(NULL, 0, interseach, this, 0, W_PD);
I ją uruchamiam . Problem jaki się pojawia to to że chciałbym w i sec przekazać jako parametry funkcji jak to zrobić ?