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, 22.06.2019 01:20
What is the full meaning of rfid in computer
Answers: 2
question
Computers and Technology, 22.06.2019 11:40
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
question
Computers and Technology, 24.06.2019 23:30
Does anyone have the problem where you try to watch a video to get your answer but it brings up a thing asking your gender to make ads relevant but it doesn't load? btw i won't be able to see the answer so use the comments .
Answers: 1
question
Computers and Technology, 25.06.2019 09:00
(environmental science semester 1) which statement best describes the limits of science? a. science cannot answer any abstract questions. b. when used properly, science can answer any questions. c. usually science can answer only mathematical questions. d. science cannot answer religious questions.
Answers: 2
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, 06.10.2020 14:01
question
Mathematics, 06.10.2020 14:01
question
Business, 06.10.2020 14:01
question
Mathematics, 06.10.2020 14:01