I've only recently started to work in C++, so I'm not quite adept to it yet. What I was trying to do is to make is read bytes from multiple files and write them to new file in their respective order, and also write locations and length of each file into another file. I don't even know how to start here, if I used .NET to do this it wouldn't be a problem for me, but in C++ as I mentioned, I am a newb to it. What I'm asking for is someone to give me pointers or any kind of help so I can accomplish this.
it exports the file, but it is not the same as the one i inputted inside, the size appears to be bigger by few hundred bytes, but the beggining and the ending bytes i looked at with hex editor appear to be same for the both files, still if the file is image, the input file looks normal, while the output one is a junk of pink pixels
ALSO not to create confusion, this is the ini file:
p_Sun_Flower.jpg=c.pack
s_Sun_Flower.jpg=0
l_Sun_Flower.jpg=275854
p_core.lua=c.pack
s_core.lua=275854
l_core.lua=115
p_Maples.jpg=c.pack
s_Maples.jpg=275969
l_Maples.jpg=379128
p_ = package file
s_ = address/location in file
l_ = length in bytes (seems to be correct when compared to original file)
Mmm, not sure what's going on. The thing to do is print the values of StartI and LengthI. Check the file size is LengthI. Compare the bytes in the source file starting at StartI.
I've rearranged your code to make it more readable (to me). I've removed close() calls, used an smart pointer to manage the dynamic buffer, and truncated the file before use.