Getting segmentation violation error

I am trying to run a program called “muangle2root.cpp”. It compiled successfully but when i ran the executable file “muangle2root”, it is giving the error. I am posting the error message here.
I am attaching the code also. please suggest me where I am doing wrong ?

*** Break *** segmentation violation
Generating stack trace…
0x423f7c10 in strcpy + 0x10 from /lib/i686/cmov/
0x080634ba in main + 0x3b from ./muangle2root
0x4239bca6 in __libc_start_main + 0xe6 from /lib/i686/cmov/
0x0804c601 in from ./muangle2root

muangle2root.cpp (4.75 KB)

Hi Tanuj,

I would suggest to compile your program in debug mode and try to debug it with gdb…

Cheers, Bertrand.

Hi Bertrand,
Thanks for your suggestion. I found the problem and correct it. Now it is working fine. :smiley: