Question: C++ language 1, Array/File Functions write a program named arrayToFile. The function should accept three arguments: the name of a file, a pointer to an
C++ language
1, Array/File Functions
write a program named arrayToFile. The function should accept three arguments: the name of a file, a pointer to an int array, and the size of the array. The function should open the specified file in binary mode, write the contents of the array to the file, and then close the file.
write another function named fileToArray. This function should accept three arguments: the name of a file, a pointer to an int array, and the size of the array. The function should open the specified file in binary mode, read its contents into the array, and then close the file.
write a complete program that demonstrates these functions by using the arrayToFile function to help me an array to a file, and then using the fileToArray function to read the data from the same file. After the data are read from the file in to the array, display the array's contents on the screen.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
