What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?
int main()
{
int fd;
close(1);
fd = open(“logfile”,O_RDWR, 0744);
write(fd, “Hello”, 5);
printf(“World\n”);
return 0;
}
int main()
{
int fd;
close(1);
fd = open(“logfile”,O_RDWR, 0744);
write(fd, “Hello”, 5);
printf(“World\n”);
return 0;
}A. Hello
B. HelloWorld
C. World
D. None
Answer: Option B

Join The Discussion