C++ program on visual studio. This is the sample code: Write a program which doe
ID: 3821516 • Letter: C
Question
C++ program on visual studio.
This is the sample code:
Write a program which does the following: Declares two integer arrays, a & b, both eleven elements long, containing the numbers: a. array a: 543516756 1667855729 1919033451 544110447 544763750 1886221674 1986994291 1948283493 1814062440 544832097 778530660 b. array b: 0 0 0 0 0 0 0 0 0 0 0 Opens a file called "binary.dat" and writes the array a to the file in binary format Closes the file (be sure to do this, or the rest of the program won't work right!) Opens the file "binary.dat" for reading, and read the data into the array b Outputs both arrays a & b to the console so you can verify that you read the data back again properly. Look at the contents of the file with a text editor and compare it to the contents of sample_binary.dat. Does it make sense? (To open it with a plain-text editor, such as Notepad app on PC or textedit on Mac, you can copy it to "binary.txt", or select "all files" in the file-open dialog box. The sample program above should help if you get stuck (or refer back to my slides). Name your program binary_io.cppExplanation / Answer
}
ofs.close()
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.