Reading console output

I am writing a program that uses system() to pass commands to the command interpreter. Is there a way to read the output that the commands produce?

Thanks for the advice! I shall try it.