Question: what I have: #include // std::ifstream, std::ofstream int main () { std::ifstream infile (test.txt,std::ifstream::binary); std::ofstream outfile (new.txt,std::ofstream::binary); // get size of file infile.seekg (0,infile.end); long

what I have:
#include// std::ifstream, std::ofstream int main () { std::ifstream infile ("test.txt",std::ifstream::binary); std::ofstream outfile ("new.txt",std::ofstream::binary); // get size of file infile.seekg (0,infile.end); long size = infile.tellg(); infile.seekg (0); // allocate memory for file content char* buffer = new char[size]; // read content of infile infile.read (buffer,size); // write to outfile outfile.write (buffer,size); // release dynamically-allocated memory delete[] buffer; outfile.close(); infile.close(); return 0; }
3. Write a C++ function that takes a string array of assembly language commands and a ifstream reference as parameters. Given that the indices of the array represents the opcode of the assembly language commands and the ifstream object's file consists rows of 32 bit binary strings, make the function store the translated instructions in another file. 3. Write a C++ function that takes a string array of assembly language commands and a ifstream reference as parameters. Given that the indices of the array represents the opcode of the assembly language commands and the ifstream object's file consists rows of 32 bit binary strings, make the function store the translated instructions in another file
Step by Step Solution
There are 3 Steps involved in it
To solve this problem you need to write a C function that translates binary strings into assembly language instructions based on a given opcode array ... View full answer
Get step-by-step solutions from verified subject matter experts
