I would like to exit my program with
system("exit");
in C.
I compiled my code with gcc and run it via terminal. But somehow the program didn't execute the call to the system to exit. Why is that happened? Because if I did system("clear")
it work smoothly
In C, system()
starts a shell and executes the command. exit
exits the shell. The expected result would be that nothing happens, what result did you get?
I think what you want is:
#include <stdlib.h>
exit(EXIT_SUCCESS);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With