Line 22: is that the one with perror()? I don't see anything wrong with it.
reading the context of the error, you can see that line 22 on his side doesn't match up with line 22 as they are numbered here. his line 22, the one with the error, is :
res = sem_init(&A,B,C 0, 0);
obviously, you are not passing in the expected argument types to sem_init. the first argument must be a pointer to a structure of type sem_t. the second an int. the third an unsigned int.
all of your parameters are void pointers. and you've got an extraneous fourth (and maybe fifth??) argument, not sure why the extra stuff is there.
you have other problems as well, but you need to fix this first, then recompile.
you should review sem_init(), as well as the rest of the <sempaphore.h> library. working through an example will help you tremendously.
.