am having these errors:
/home/Desktop/L5Q1.c: In function ‘main’:
/home/Desktop/L5Q1.c:15:9: warning: incompatible implicit declaration of built-in function ‘printf’
/home/Desktop/L5Q1.c: In function ‘funct1’:
/home/Desktop/L5Q1.c:26:9: warning: incompatible implicit declaration of built-in function ‘printf’
#include <pthread.h>
void * funct1(void * arg);
main()
{
pthread_t threadid;
int i,j;
int x=1;
pthread_create(&threadid,NULL,funct1,(void *)&x);
for (j=0; j <10; j++)
{
for (i=0; i<1000; i++);
printf("Hi I'm the parent\n");
sleep(2);
}
}
void * funct1(void * arg)
{
int i,j;
for (j=0;j<10; j++)
{
for (i=0; i<1000; i++);
printf("Hi I'm the created thread\n");
sleep(1);
}
}