Hi,
Can someone elaborate why the following (the if conditional) differs
int main(){
const char *filename = "test.txt";
int ifd;
if((ifd=open(filename,O_RDONLY))<3)
err(EX_NOINPUT, "%s", filename);
fprintf(stderr,"ifd is:%d\n",ifd);
off_t bytes_in = lseek(ifd, (off_t)(-4), SEEK_END);
return 0;
}
vs
int main(){
const char *filename = "test.txt";
int ifd;
if(ifd=open(filename,O_RDONLY)<3)
err(EX_NOINPUT, "%s", filename);
fprintf(stderr,"ifd is:%d\n",ifd);
off_t bytes_in = lseek(ifd, (off_t)(-4), SEEK_END);
return 0;
}
Basicly it looks like adding additional paranthesis, makes the conditional test on the evaluation of the rval. And the assignment is a sideeffect?
thanks