Question: For this problem, using the following template For our final challenge, you will create a binary file (using streams) that contains N blocks of an

For this problem, using the following template

For this problem, using the following template For our final challenge, youwill create a binary file (using streams) that contains N blocks of

an equal (fixed) size. Each fixed- sized block will contain characters of

For our final challenge, you will create a binary file (using streams) that contains N blocks of an equal (fixed) size. Each fixed- sized block will contain characters of a given value. No two blocks will contain the same character. You might mentally visualize the block sequence like this: AAAAAA BBBBBB CCCCC DDDDDD (etc) Opening a stream in "binary" mode is done using settings, which have already been set up for you on the BinaryStreamwriter class. Your job will be to write blocks of data, filled with a given character, into the binary stream. Once again, your project contains a good start on the code necessary to do this work. Just look for comments in the code that indicate where you need to add code. #include "BinaryStreamWriter.hpp" namespace A { BinaryStreamWriter::BinaryStreamWriter(const char* aPath, const char* aFilename) { char thePath[512]; sprintf (thePath, "%s/%s". aFilename); aPath, //STUDENT: open your output stream in binary mode... int BinarystreamWriter: :run (int aBlockCount, size t aBlockSize) { //iterate for 1..aBlockCount //create a buffer of given size (aBlockSize) //fill the buffer with a unique char from alphabet.. //write each block sequentially to binary stream... return 0; #ifndef BinaryStreamWriter_hpp #define BinaryStreamWriter_hpp #include #include Enamespace A { class BinaryStreamWriter { public: BinaryStreamWriter(const char* aPath, const char* aFilename); int run (int aBlockCount, size t aBlockSize=32); protected: //STUDENT: declare your binary stream here... } ; #endif /* BinaryStreamWriter_hpp * /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!