前言:c语言中创建一条线程,但是需要传送多个参数给线程的话我们自然会想到通过传送数组或者结构体来实现,下面我们来看看如何在创建线程的时候传送结构体和数组。
1 #include <stdio.h> 2 #include <pthread.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 typedef struct Student 7 { 8 int num; 9 char name[10
前言:c语言中创建一条线程,但是需要传送多个参数给线程的话我们自然会想到通过传送数组或者结构体来实现,下面我们来看看如何在创建线程的时候传送结构体和数组。
1 #include <stdio.h> 2 #include <pthread.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 typedef struct Student 7 { 8 int num; 9 char name[10