1

I have a existing program and I can't modify it. It use std::cin to read user's input.

Now I don't want to type in it every time, so I create a file like this:

3
2 2
3 4
5 1

How do I use this file as input stream ? I'm using OS X.

1
  • 1
    Which shell are you using? Commented Oct 28, 2013 at 9:11

1 Answer 1

3

If you are using the bash (or similar) shell and your input is in the file input.in then

myprogram < input.in

Will use input.in as the standard input to the program.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.