How to run an external program and wait until the program closes.

I'm using system() to run an external program with parameters. I want the code to wait until the program closes and then proceed with the rest of the code.
Right now, the command to run the program is in a loop, so it keeps opening more of the same program.
thanks in advance.
closed account (48bpfSEw)
http://www.cplusplus.com/forum/lounge/17684/
Thanks, but it doesn't say how to wait for the exit in windows.
I'm using windows.
Topic archived. No new replies allowed.