If I have a C program that I compile successfully and generate an executable, how do I instruct the program to open a new terminal window when I run it from the command line in
You have to execute the terminal emulator. In my case (I have Kubuntu) it's Konsole, so it would be system("konsole")
.
If I wanted it to execute ls on the current working directory, it'd be:
system("konsole --hold -e ls .");
What you can't do with system is control the spawned terminal. On the other side, if you use fork+exec, maybe you can interact with it by redirecting its streams (dup2)