I’m working on a C++ project and one of the libraries that I’m using has the following line:
typedef void (*thread_startfunc_t) (void *);
Can someone please explain what this is doing. Thanks
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.
It defines
thread_startfunc_tas a synonym for the type “pointer to a function that takes a single argument, of typevoid *, and returnsvoid“.Note that the
_tsuffix is actually reserved by POSIX, so I think this is bad code in that respect, but the use of atypedeffor pointer-to-function types is always a good idea. This is a very common practice.