Message from @Goz3rr
Discord ID: 473824982485696523
Can't I just take the write() output, but use that instead?
Cause the write() is completely fine
no
listen
the output is the same in raw bytes
most likely
yes
confirm this with a hex editor
xxd or whatever
woah
there is something there
but why is that not reversed
if write() can display the reversed array fine
why cannot this
wait wait!
it is working!
but the file displayed is still corrupted chink runes
that might be a reason
because your input string is probably null terminated
that ends up at the start of the string
```
fwrite(mmappedData, 0, filesize, f);
```
if that second statement is zero, then nothing will printout
if it's one, it misses the first character, but is reversed, but is corrupted
well, the second argument is size isn't it
if you set it to 0 then it would indeed write fuck all
oh cool
setting it to 2 gives the output, but loads of nulls
this is great news
because now you've told fwrite that each of your items to write is 2 bytes long
when it is infact 1 byte long
indeed
and you're reading outside the bounds of your mmapped array
output is now 2x larger
which happens to be 0x0
changing your reverse array function should work
almost got it