C program to replace the specified line in an existing text file
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Read the line number from the user, and then replace the content-specific line with new text in the existing file. Then print the modified content file.
Program:
The source code to remove a specific line from the text file is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
Output:
Explanation:
Here, we read and print the content of an existing file. Then read the line number from the user to replace the line from new content in the existing file. After that, we printed the modified content file.
need an explanation for this answer? contact us directly to get an explanation for this answer