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 15:00
Marissa is a high school student who wants to be a hydroelectric production manager. she talks to her guidance counselor about her education path, and the counselor says that she needs to get an associate’s degree from a four-year college and will follow that with significant on-the-job training. what error did the counselor make while advising marissa? marissa will not have on-the-job training. marissa also needs a three-year apprenticeship. marissa only needs to attend a two-year college. marissa needs a bachelor’s degree.
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
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, 19.10.2019 04:10
question
Mathematics, 19.10.2019 04:10
Questions on the website: 13722363