You don't say how you want the redirection to take place but, assuming you want to keep the use of the
system command, you will have to use the shell to do it since
system only returns an error code & signal resulting from the call e.g.
system("cmd > file");
A user level that continues to overstate my experience :-))