Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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);
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions