Q: How to "ignore" segfault in cpp? So, this question might sound quite strange, but let me explain:
I have written a code in C++ to analyze some data, and this data is separated in files. I pass names of these files (there are many of them) as an argument to the program.
Maybe I've made some mistake in my code or maybe the data in some of these files ain't "good" and that doesn't matter for now. But for some files the program stops and returns me a segfault message. 
There is a way to even with the segfault jump to the next file in the argument list using only C++?
Maybe I could use some shell script to run it for each of the files and then, if I get a segfault it'll continue running one by one. But that is not what I want for now, if I can't solve this I will try this way.
Thank you guys in advance.

A: You can in fact install a signal handler for SIGSEGV (on most Unix like operating systems) that will be called when your program runs into a segfault, and if you wish you can handle that in whatever way seems appropriate (including ignoring it). Doing so is quite esoteric (java does it, but that's the only semi-sane usage I've ever seen) and rarely the right thing to do, and dealing with the fault correctly in such a handler is difficult as you can't really be sure what caused the fault and what the state of your program is after you return from the signal handler.
So, while you can "handle" SIGSEGV I'd advice you instead look into other ways of sanitizing your input data so that you instead avoid the segfault in the first place.
