Question: IN C LANGUAGE For this lab, you are going to create two programs. The first program (named AsciiToBinary) will read data from an ASCII file
IN C LANGUAGE
For this lab, you are going to create two programs. The first program (named AsciiToBinary) will read data from an ASCII file and save the data to a new file in a binary format. The second program (named BinaryToAscii) will read data from a binary file and save the data to a new file in ASCII format.
Specifications: Both programs will obtain the filenames to be read and written from command line parameters. For example: bash$ AsciiToBinary ascii_in binary_out
bash$ BinaryToAscii binary_in ascii_out
The data contained in the ASCII file (both reading from and writing to) will be 10 signed integers, 10 floating point numbers, and 10 lines of text. There will be only one data item per line, and each line of text will contain up to 40 characters (including ' ' and the NULL terminator).
The data contained in the binary file (both reading from and writing to) will be 10 signed integers, 10 floating point numbers (of type double), and 400 characters. You may find it helpful to think of the 400 characters as 10 sets of 40 characters each.
Sample ASCII and binary format files are provided. The data in the two files correspond to each other. There will be no blank lines found in either file.
The specific method that you use to read and write the data is up to you. You may wish to read all the data from the input file before writing to the output file, or you may wish to write each data element as it is read.
Be sure to close both files (input and output) before exiting the program.
ASCII FILE -----------------------------
6738 23011 -54238 47231 4 -563 528032 7892245 -64927864 262 6738.2342 23011.6540 -54238.3462 47231.0000 4.7204 -563.6238 0.0024 7892245.5238 -64927864.6289 262.2017 The quick brown fox jumped over the lazy dog. To program or not to program... George Mason University Department of Computer Science CS262 is an awesome class! The C Programming Language is superior to all other languages including Latin, Old Norse, Beothuk, and Sumerian!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
