0

I'm in a course for C++ programming.

Our professor created a linux validation script against which our program output must match exactly.

The problem is, this program excepts probably 150-200 lines of input and if anything goes in wrong you have to start all over again. If you even enter an incorrect char, it must be restarted as the backspace registers as a character of its own.

Is there a way I can force the CIN input to match exactly, so that the program will input the data on its own according to my specifications?

bigcodeszzer
  • 916
  • 1
  • 8
  • 27
  • "*Is there a way I can force the CIN input to match exactly, so that the program will input the data on its own according to my specifications?*" Huh? Are you talking about validating input or output? – David Schwartz Dec 02 '15 at 23:44
  • 2
    Why are you typing into the validation script instead of piping your program's output into it? – user253751 Dec 02 '15 at 23:46
  • I tried putting it in like submit < myinput.txt ... but it didn't work for some reason. – bigcodeszzer Dec 03 '15 at 00:46
  • see here http://stackoverflow.com/questions/34055210/script-program-inputs-in-bash-ubuntu-linux/34055278?noredirect=1#comment55865419_34055278 – bigcodeszzer Dec 03 '15 at 00:46

1 Answers1

3

No, there isn't. You must know what is being expected beforehand to pass the validation.