output to text file

I want the output of a c++ program to be printed in a text file instead of command line/console. how to do it?

I am using dev c++ 4.9.9.2 compiler.
thnx dude
another way is to run the program from the command line and redirect the output to a file
myprogram > filename.txt

Topic archived. No new replies allowed.