Message from @spaqin
Discord ID: 473822023227801620
I know C @why am I 𝓐𝓛𝓘𝓥𝓔 what is your problem
hello dear am C programmer too
why use dead language
@spaqin So when using the write function it returned the mmapedData backwards after the reverseArray function
So that is fine
But then putting that into the file gives a corrupted file that is the same file size
How corrupted
the file size is the same
so the data is certainly there
it's literally supposed to be backwards
Did you check the data in the program?
yes, that's what I see with the write() command in the code
it's prints that all out backwards in the terminal
You could've also somehow messed up the params?
looks like your encoding is wack
But I want that in a plain text
Or it could be UTF8
if it's anything except ASCII you can't just reverse the bytes and have it work
@Goz3rr no no
```
void reverseArray(char* mmappedData, int start, int end) {
int tmp;
while(start < end) {
tmp = mmappedData[start];
mmappedData[start] = mmappedData[end];
mmappedData[end] = tmp;
start++;
end--;
}
}
```
In place reversal
you are reading bytes
a char is a byte
No bits were turned in reverse
Pass me the fwrite incantation you use
incantation lol
```
fwrite(mmappedData, 1, filesize, f);
```
im stealing that
Can't fuck that up lmao
mmapedData is a char* array from a mmap() command
1 is the start of the array
Give it a simple file first
compare your two files in a hex editor
ah ok sorry
one moment
instead of a text editor
to begin with
Tru