Question: C Basic (deleting a line in a file) How would one take a file that has a list of things, each on a sperate line

C Basic (deleting a line in a file)

How would one take a file that has a list of things, each on a sperate line in the file, and ask the user which line they want to delete from the file and then print the new contents of the file without having an empty line from the deleted string? Could i get a sample code? Also What if i wanted to delete all contents of the file?

This is whats supposed to happen:

1. some text

2. somemore text

3. something else

which line would you like to delete? : 2

1. some text

2. something else

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!