gpt4 book ai didi

c - 将多个参数传递给 pthread_create

转载 作者:行者123 更新时间:2023-12-02 06:40:31 35 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Multiple arguments to function called by pthread_create()?
How to pass more than one value as an argument to a thread in C?

我有这些结构:

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?不管结构体各字段的含义。

pthread_create(&id,NULL,thread_func,????HERE????);

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com