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.exitexits the shell. The expected result would be that nothing happens, what result did you get?I think what you want is: