I’ve come across this piece of code in my O.S book:
void *foo()
{
// does something
pthread_exit(NULL);
}
What is the meaning of void *foo?
Does that mean the function return a pointer to something of type void?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
void *means it returns a pointer to some type, it isn’t specified which. In order to be used the pointer is casted to the appropriate type and then used. The fact thatvoid *foois just a matter of spacing.Check out this explanation