As the title says.
I am having a segmentation fault in my program.
The code is a fairly simple one - to do a set union on two arrays. I am making use of pointers and that's probably where the bug's occurring. I have been trying for the past two hours but as of now, I am unable to spot any bugs in it. So, in the end, now I am thinking to debug it as the last option.
The arrays take user input and I am stumped since I am unable to use the debugger on them. I know very basic stuff about how to use GDB to debug fairly simple programs and my past experience was always with arrays that already had data in them.
I tried searching on Youtube but was unable to find any source about it.
Does anyone know how to do it? Or maybe some resource that explains how to do it? It would be greatly helpful to me!