i have the following code
int arr[5];
printf("Input values:");
for (i=0;i<5;i++)
scanf("%d",&arr[i]);
pthread_create(&thread1, NULL, &inputfunction, (void *)&arr);
pthread_join(thread1,NULL);
return 0;
}
void *inputfunction(void *ptr_value)
{
int value= *((int *) ptr_value);
printf("value=%d", value);
// printf(&(ptr_value));
return NULL;
}
I want to retrieve all the 5 values I have entered in the array but using this code in the body of the function returns just the first value. I am very confused with pointers and am not able to figure out the way to get the entire array.
please tell me what is the modification I need to make in my code.
Thanks