Skip to content
Advertisement

Reading 2 byte at a time from a binary file

I have an elf file that called example. I wrote following code which it’s read the content of the example file in the binary mode and then I wanted to save their content in another file called example.binary. But when I run the following program it shows me a segmentation fault. What’s wrong with this program? I can’t find out my mistake.

JavaScript

Advertisement

Answer

change your typedef to typedef char* __charptr

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement