Click here to Skip to main content
14,865,403 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
main()

int fd = open("file.txt", O_RDONLY);

fd = open("file2.txt", O_RDONLY);

int loc = lseek(fd, 0x100, 1);

cout << loc << endl;

}

What I have tried:

I want to know the output I tried 100 but did not work.
Posted
Updated 21-Mar-21 13:43pm
v3
Comments
Mohibur Rashid 18-Mar-21 19:51pm
   
you read the second file without closing the first one, what is the content of file2.txt? is that file in the right directory?
Richard MacCutchan 19-Mar-21 6:05am
   
Well you need to go back to the book as there is definitely something missing.
Richard Deeming 23-Mar-21 6:22am
   
Removing the content of your question after solutions have already been posted is extremely rude.

It will also not prevent your teacher from noticing your attempt to cheat on your homework.

I have reverted your destructive edit.

We're not here to do your work for you.

Go read the documentation on lseek and read what it says about what it returns and why. I'm sure it was covered in your book, and if not, go Google for "c lseek function".
   
Do you know what 0x100 means? That would be the key to your question.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900