hi everyone, i'm trying to do a program in c, GCC UNIX and i have this error: warning: passing argument 2 of write
makes pointer from integer without a cast
i try to use TUBE, communication between process and i use write(fd[1],2,1);
but it gives this error please i nead a help, this is the code:
pid1=fork();
if (pid1>0)
{
printf("chui pereeeeeeeee n %d\n",getpid());
close(fd[1]);
int val;
do
{
read(fd[0],&val,1);
printf("%d",val);
}
while(val!=0);
close(fd[0]);
}
else
{
printf("chui fils createur n %d\n",getpid());
close(fd[0]);
for(i=deb;i<=n;i++) {printf("%d ",t[i]);}
printf("\n\n");
printf("%d\n",n);
deb=6;
n=premier(t,deb,n);
for(i=deb;i<=n;i++) {write(fd[1],t[i],1);}
write(fd[1],0,1);
close(fd[1]);
}