subject

I need help writing 3 files, myio. c, driver1.c, and driver2.c. I have provided myio. h down below:Implement the following library and driver programs under assign0:Your library will be consisting of myio. h and myio. c. The function prototypes as well as more explanations are listed in myio. h. Please download it and accordingly implement the exported functions in myio. c. Basically, you are asked to develop a simple I/O library which exports a few functions to simplify the reading of an integer, a double, and more importantly a string (whole line). In contrast to standard I/O functions that can read strings (e. g., scanf with "%s", fgets) into a given static size buffer, your function should read the given input line of characters terminated by a newline character into a dynamically allocated and resized buffer based on the length of the given input line. Also your functions should check for possible errors (e. g., not an integer, not a double, illigal input, no memory etc.) and appropriately handle them. Then write driver programs that can simply use the functions from myio library. Specifically, you will write two driver programs:First one (say driver1.c) gets three command-line arguments: x y z. It then asks user to enter x many integers, y many doubles, and z many lines. Everytime the program prints back the entered data on the stdout while printing error messages on stderr (if any). It also keeps track of the largest integer, double and the longest string. At the end, your program prints the largest intiger, double and the longest line. string that were entered. Second one (say driver2.c) gets two command-line arguments: input_file. txt output_file. txt. Here is a sample input_file. txt , which is a text file containig many lines. Your program reads each line and removes theextra space characters between the words and prints the new line into output_file. txt. So there will be at most one space character between the words in output_file. txt. myio. h :/* * File: myio. h * Version: 1.0 * Last modified on Wed Dec 12 11:37:26 2016 by korkmaz * This is mostly from a similar file provided by eroberts * * This interface provides access to a basic library of * functions that simplify the reading of input data. */#ifndef _myio_h#define _myio_h/* * Function: ReadInteger * Usage: i = ReadInteger(); * * ReadInteger reads a line of text from standard input and scans * it as an integer. The integer value is returned. If an * integer cannot be scanned or if more characters follow the * number, the user is given a chance to retry. */int ReadInteger(void);/* * Function: ReadDouble * Usage: x = ReadDouble(); * * ReadDouble reads a line of text from standard input and scans * it as a double. If the number cannot be scanned or if extra * characters follow after the number ends, the user is given * a chance to reenter the value. */double ReadDouble(void);/* * Function: ReadLine * Usage: s = ReadLine(); * * ReadLine reads a line of text from standard input and returns * the line as a string. The newline character that terminates * the input is not stored as part of the string. */char *ReadLine(void);/* * Function: ReadLine * Usage: s = ReadLine(infile); * * ReadLineFile reads a line of text from the input file which * is already open and pointed by infile. It then reads the line, * dynamically allocates space, and returns the line as a string. * The newline character that terminates the input is not stored * as part of the * string. * The ReadLine function returns NULL if infile is at the * end-of-file position. * Note: the above ReadLine(); can simply be implemented as * { return(ReadLineFile(stdin)); } */char *ReadLineFile(FILE *infile);#endif

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:20
Write a select statement that returns product name, customer first name, customer last name, channel description, and amount sold for all the sales. make sure to returns sales even if there is no information on the customer, product, or channe
Answers: 2
question
Computers and Technology, 22.06.2019 13:30
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. centurion: a commander in the army of ancient rome. keyword: picture:
Answers: 2
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
You know the right answer?
I need help writing 3 files, myio. c, driver1.c, and driver2.c. I have provided myio. h down below:I...
Questions
question
Mathematics, 04.12.2020 21:10
question
History, 04.12.2020 21:10
Questions on the website: 13722361