[Solved] How to return general purpose pointers in a c function?


void *job(void *arg){
   //does something, no return type
}

as to return a void*, no return type is false

void and void* and different

This notation can be used like in an other way:

void *method = job;

this is not the correct way if you want to say you save a pointer to the function job, must be void *(*method)(void) = job;

void *method = *job; is wrong, if you use the option -pedantic you will have the error ISO C forbids initialization between function pointer and ‘void *’ [-Wpedantic]

I encourage you to ask for the high level of warning/error, if you use gcc do gcc -pedantic -Wextra for instance

1

solved How to return general purpose pointers in a c function?