here is what my .bat file looks like:
cd C:\cygnus\cygwin-b20\H-i586-cygwin32\bin
g++ -g hello.cpp -o hello -lm
start hello.exe
I need the results of hello.exe written to text file. Can you help me ?
here is what my .bat file looks like:
cd C:\cygnus\cygwin-b20\H-i586-cygwin32\bin
g++ -g hello.cpp -o hello -lm
start hello.exe
I need the results of hello.exe written to text file. Can you help me ?
hello > output.txt 2>&1
will catch both standard output (1) and standard error (2) and send them to output.txt.
A quick Google search on "batch file pipe results to text file" brings you to this page.
If you are on windows, install Cygwin, then the operation
hello > file.txt
should work (as posted in the comment)