News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Redirecting standard input

Started by candide, February 05, 2009, 12:36:21 AM

Previous topic - Next topic

candide

Hi all

I try to redirect standard input from a text file to an executable program generated with codeblocks. With C::B running under Linux Ubuntu, from the menu Projet > set program's arguments, setting the program argument's box to

< foo.txt

does redirect the standard input to the foo.txt text file.

But this doesn't work under Windows. Another way to do this ?



ollydbg

Under windows, You should use:

XXX.exe >> a.txt


Which redirect the standard output to a.txt
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

candide

Quote from: ollydbg on February 05, 2009, 06:38:00 AM
Under windows, You should use:

XXX.exe >> a.txt


Which redirect the standard output to a.txt
The question was on redirecting

  • standard INPUT (and not output)
  • from inside codeblocks and not  from the command line.

ollydbg

Sorry for my mistake :D.
But I haven't heard direct INPUT in windows....
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Not related to C::B and therefore violating our forum rules.

Topic locked.