Question: we are getting the following error in our c program : munmap _ chunk ( ) : invalid pointer. Kindly find the screenshot to resolve

we are getting the following error in our c program : munmap_chunk (): invalid pointer. Kindly find the screenshot to resolve our issuestruct s1{
int start;
int end;
int *a;
int countPrime;
};
int prime(int num)
{
if (num =1) return ;
for (int i=2;i(num ?2; i++)
if (num %i==0) return ;
return 1;
}
void *tfunction(void *args){
struct s1*t1=(struct s1**) args;
int start = t1 start;
int end = t1 end;
int count =;
for(int i= start; i end; i++
int n=t1a[i];
if (prime(n)){
count ++ ;
}
}
t1 countPrime = count;
int *tr = malloc(sizeof(int));
*tr = count;
pthread_exit(tr);
}
 we are getting the following error in our c program :

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!