How do I redirect the stdin and stdout in such a way that it could be put into a string? I want to do this so that a program run using system() or one of the exec functions would recieve its input from the program and its output would go to the program, instead of to the screen. This is in the c programming language in Linux.