#Opening a binary file, and modifying an entry. as well as adding a new entry.

8 messages · Page 1 of 1 (latest)

winged haven
#

#include "Part1SimpleFileModifier.h"
#include "FileModifyException.h"

void Part1SimpleFileModifier::modifyAndCopyFile(const char *sourceFile, const char *destFile)
{
//enter code here.
}
So the file I'm trying to access is called Util.cpp; I need to modify a binary file and write it out to a new file. Using open(), close(), read(),write(). I'm lost as to where to begin.

pure totemBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

winged haven
#

While making the copy, you will change two items:

  1. Modify the first entry, making these changes:
    a. Price: 1,000,000
    b. Item ID: 12345
    c. Name: “SE 3242” (make sure it’s in an array that’s big enough!)
  2. Add a new entry at the end:
    a. Timestamp: 1613412000
    b. Item ID: 6530927
    c. Price: $89.99
    d. Name: “Advanced Programming in the UNIX Environment by Stevens and Rago”
    (warning: this is more than 49 characters!). These are the entries I need to change and add.
urban peak
#

begin with int main()

winged haven
#

!solved

pure totemBOT
#

Thank you and let us know if you have any more questions!

#

[SOLVED] Opening a binary file, and modifying an entry. as well as adding a new entry.