What do you want to save?
Add Code snippet
New code examples
-
C 2021-11-17 20:29:24
how to pass an array value to a pthread in c
void* my_Func(void *received_arr_Val){ int single_val = (int *)received_arr_Val; printf("Value: %d\n", single_val); //Now use single_val as you wish } //In main: int values[n]; pthread_create(&thread, NULL, my_Func, values[i]); ... Add solution -
C 2021-09-26 00:40:02
how to pass an array to a thread in c?
void* my_Func(void *received_arr_Val){ int single_val = (int *)received_arr_Val; printf("Value: %d\n", single_val); //Now use single_val as you wish } //In main: int values[n]; pthread_create(&thread, NULL, my_Func, values[i]); ... Add solution -
C 2021-09-17 02:41:03
How to pass a struct value to a pthread in c?
struct my_Struct{ int val1, val2; }; void* my_Func(void *received_struct){ //Creating a pointer to point to the received struct struct my_Struct *struct_ptr = (struct my_Struct*) received_struct; printf("Value 1: %d | Value 2: % \n", st... Add solution