可能重复:
Multiple arguments to function called by pthread_create()?
How to pass more than one value as an argument to a thread in C?传递多个参数,以在pthread_create
我有这些结构:
struct Request {
char buf[MAXLENREQ];
char inf[MAXLENREQ]; /* buffer per richiesta INF */
int lenreq;
uint16_t port; /* porta server */
struct in_addr serveraddr; /* ip server sockaddr_in */
char path[MAXLENPATH];
/*struct Range range;*/
};
struct RequestGet {
char buf[MAXLENREQ];
int maxconnect;
struct Range range;
};
struct ResponseGet{
char buf[MAXLENDATA];
//int LenRange;
int expire;
char dati[MAXLENDATA];
struct Range range;
};
我怎样才能把它们传递给pthread_create
?不管每个结构领域的意义如何。
我已经看到了,但我的疑问是关于三种不同结构的malloc的... – rschirin
的可能重复[多参数功能通过在pthread_create()调用?(http://stackoverflow.com /(问题/ 1352749 /),[pthreads和C++](http://stackoverflow.com/questions/2468113/),[将多个参数传递给C(pthread_create)中的一个线程](http://stackoverflow.com/questions/6524433 /) – outis