Simple C Programming Project

Relax! Stop worrying about deadlines and let our professional writers help you. Hire an essay writer helper and receive a professional assignment before your deadline. We provide writing services for all types of academic assignments.


Order a Similar Paper Order a Different Paper

In this assignment, you need to write a program to the following specifications:

  • In the current directory there are several files
  • Some of the files in the current directory are text files containing lines of text, each
    line ending with the line-feed character. The names of these files end with the
    extension .txt.
  • Write a C program that:

    • Uses standard I/O functions from the C library
    • Is called with three command-line arguments: a ‘find’ parameter, a ‘replace’
      parameter, and a ‘prefix’ parameter
    • For each .txt file in the current directory, does the following:

      • Searches the file for any occurrences of the ‘find’ parameter, and
        replaces them with the ‘replace’ parameter
      • If there were no occurrences of the ‘find’ parameter, the program
        searches for the ‘prefix’ parameter
      • For any occurrences of the ‘prefix’ parameter, the program prepends
        the ‘find’ parameter to the left of the occurrence
      • If there are no occurrences of the ‘prefix’ parameter, the program
        should do nothing to the file.
    • Prints a log of its activities to stdout. The log should include the name of
      each text file and the type of operation done on each line.
  • Be particularly careful about replacing strings of different lengths; make sure to
    allocate additional memory if needed!
    70 Points: Program correctness
    30 Points: Program documentation and code style (10), readme (10), makefile (10).

Great students hand in great papers. Order our essay service if you want to meet all the deadlines on time and get top grades. Professional custom writing is the choice of goal-focused students. Word on the online streets is... we're simply the best!

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper