and here is the foo2,and foo:
c:109:void foo(threadpool tp,void (*func)(void), (void*)arg){.........}
c:110: void * foo2(void *arg) {......}
gcc gives me those things:
c:63: error: expected declaration specifiers or �...� before �(� token
c:104: warning: passing argument 2 of �foo� from incompatible pointer type
c:63: note: expected �void (*)(void )� but argument is of type �void * ()(void *)�
c:104: error: too many arguments to function �foo�
c:110: error: expected declaration specifiers or �...� before �(� token
c:110: error: expected identifier or �(� before �{� token
I dont know what the problem is,even if I tried a lot of things.Please help!
thanks in advance
I declare foo2 before main as this: void * foo2(void *arg);
foo2 is a function which a thread from thread pool will execute.
I correct some things and the new errors are:
c:63: error: expected declaration specifiers or �...' before �(' token
c:104: warning: passing argument 2 of �foo' from incompatible pointer type
c:63: note: expected �void (*)(void )' but argument is of type �void * ()(void *)'
c:104: error: too many arguments to function �foo'
c: At top level:
c:110: error: expected declaration specifiers or �...' before �(' token
yes, threadpool is a struct.Ok this is right,the first value should be an adress,so I changed it.But this is not the problem I have.
Now, try to declare a function prototype:
typedef void (*TypeOfFunc)(void *);
and to use this prototype when it is to declare a function like this.
But still,the problems remain..