Ok, I found I was wrong about part of the problem. I've re-written it to avoid the running out of memory problem anyway, but it turns out that because of the way the int
type in C++ works (in my compiler at least), the $C9 char
(byte) translates to $FFFFFFC9 as an unsigned int or $-36 as a signed int. It was set up as an unsigned int, so it thought there was $FFFFFFC9 files in the archive, or 4,294,967,241, so it's no wonder it couldn't allocate the necessary memory
I've fixed it by setting it as an unsigned int and then it just checks to see if it's below zero, in which case it adds $FF to it.
And the only problem with you compiling the source on your computer is that it uses Windows functions. Unless you could point me in the direction of equivalent Mac C++ coding for creating new folders?
EDIT: Attached the updated executable. I tested it and it works fine now, viewing and extracting all 201 files. Would anyone else with Windows be able to test that it works so we know for certain it's just not working because it's on a Mac?
EDIT 2: Removed buggy version, see later post for up-to-date version