I have run this code on another Linux environment where it works, but when I run this code on my machine it shows an error.
The code is:
void *functionC(void* ptr)
{
dint* pointer=(int*)ptr;
pthread_mutex_lock( &mutex1 );
int i;
for( i=pointer[0]; i <= pointer[1]; i++ )
{
sum += myarray[i];
}
pthread_mutex_unlock( &mutex1 );
}
The error I got in my machine is:
aftab@aftab-VirtualBox:~/Downloads$ gcc -o out done1.c -lpthreads
done1.c: In function ‘functionC’:
done1.c:59:2: error: unknown type name ‘dint’
dint* pointer=(int*)ptr;