This question was asked to me in an interview.
they asked me how to generate a core dump file with which i can debug. then i said that with -g flag in
-g
The gcc -g flag tells gcc to generate and embed debug information. ulimit -c is used to enable core file generation. You can have either of these without the other.
ulimit -c