T
threetoast
Is there any way to have a class function to search a struct, but the
field searched be passed to it as, say, a character array? Ex:
int book::searchChar(char r[], char tyco[])
{
for (int p=0; p<x; p++)
{
if (strcmpi(library[p].tyco, r)==0)
{
return p;
}
}
return -1;
}
This doesn't work, but it's basically the idea that I want.
field searched be passed to it as, say, a character array? Ex:
int book::searchChar(char r[], char tyco[])
{
for (int p=0; p<x; p++)
{
if (strcmpi(library[p].tyco, r)==0)
{
return p;
}
}
return -1;
}
This doesn't work, but it's basically the idea that I want.