I'm trying to compile but getting the errors
error: expected expression before 'void'
warning: passing argument 3 of 'pthread_create' from incompatible pointer type [enabled by default] used [-Wunused-but-set-variable]
I type casted the struct to void* so it should work.
In the global variable section I have
struct threadArgs
{
char** str;
int length;
};
struct threadArgs arguments;
The lines around the error are here
arguments.str = str;
arguments.length = linesRead;
for(int i = 0; i < lettersInAlpha; i++)
errCode[i] = pthread_create(&letter[i], NULL, &findMatch, (*void)&arguments);
the prototype for findMatch is void findMatch(char **str, const int length);
Also I think I'm doing the right thing by passing the arrays address, right?
Basically any code can be changed, so findMatch()
can be modified as needed.