So I'm getting a segmentation fault (core dumped) for this code. Can anyone help? I don't really know what I'm doing here.
pastebin.com/fMY6LUS9

@thomasorus I'd recommend you run that in a debugger. My preference is either for nemiver or better yet, the eclipse c standalone debugger. I'd help you more, but I'd need to be at a computer and Not on a phone.

Anyhow if you rerun your code within a debugger it will at least (probably) pinpoint the line which triggered the segfault.

Follow

@thomasorus Excellent, and don't forget to make sure you recompile your code with debugging symbols on (i.e., include the `-ggdb` flag when compiling) before trying to debug it. Otherwise the debuggers will show you disassembly instead, which isn't so helpful.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml