-1

I have the following tests below in a file and I want to run these tests but i do not want to type all of them and neither change my code which is using scanf to fscanf to read from a file, is it possible using CodeBlocks?

Sample Input 

2
3
a b c A B C
a:BAC
b:BAC
c:ACB
A:acb
B:bac
C:cab
3
a b c A B C
a:ABC
b:ABC
c:BCA
A:bac
B:acb
C:abc
Roni Castro
  • 1,968
  • 21
  • 40
  • 1
    Put the data in a file, and redirect your program's standard input to that file? Not sure how much (if anything) Code::Blocks does to support doing that when you run the program from inside the IDE though. – Jerry Coffin Aug 09 '14 at 19:51

1 Answers1

1

It is possible using terminal and stream redirection and pipes. Here's some link from google assuming you are using linux: https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-i-o-redirection

You probably need something like this (pipe):

$ cat your_file | your_binary

or (stream)

$ your_binary < your_file
konserw
  • 494
  • 2
  • 10
  • I am using Windows, but using your words i googled and found this website which explains. PS: When i use Linux i will try that. Thanks http://zhukovc.blogspot.com.br/2013/09/input-redirection.html – Roni Castro Aug 09 '14 at 20:22