To kill a process, not a program, you need to know the process id or pid. Manually, you might do "ps -ef | more" and look at the output until you find the process in question. Then you do "kill 123" or whatever. A process can detect this and shut itself down. If that doesn't kill it, then "kill -9 123" is in order.
Since you wrote the program, one useful trick is to have the program write its pid to a file, which by tradition would be called myprog.pid or something. Then you do "kill `cat myprog.pid`".
All of this is possible in C via kill() and getpid().
There are man pages on all of this stuff. So become familiar with commands like:
man -k kill
man -s1 kill
man -s2 kill
But also, if you don't know how to kill a process, I must say that it's premature to writing in C on Unix. I would advise you to read a book on unix programming.
Finally, our
rules state:
Quote:
(5) Search the forums database with your keywords before asking.
By simply putting "kill" in as keyword, you would find lots of threads about killing processes.