Writing to and reading from file in C

Hello,

I am new to file handeling in C, so what i need to do is three things,
1. delete a specific line in the file
2. Update a specific line in the file
3. Write a new line to the file without losing whats already in the file.

Example:
if the file was like this
"
cat 900
dogs 20
cows 45

"

1. example of deletion, i want to delete the dogs 20.
"
cat 900
cows 45

"

2. example of update, update the cows 45 with monkeys 58
"
cat 900
dogs 20
monkeys 58

"
3. example of adding something, i want to add horses 04
"
cat 900
dogs 20
cows 45
horses 04

"


I really need help please.
closed account (3hM2Nwbp)
Since you're writing this in C and not C++, I'll refer you to the appropriate documentation.

http://cplusplus.com/reference/clibrary/cstdio/

If you need specific questions answered, feel free to post them.
Topic archived. No new replies allowed.