how can i redirect the system(cmd)


i have used system() function in my program,

i need to redirect the output to the file;

system("test.exe 12 > temp.txt");

but it displayed in the cmd prompt when am running the program in cmd prompt. i dont want to display the result in cmd prompt.

Why dont you use fstream function?
Also, look at popen()
Topic archived. No new replies allowed.