Redirect cin (c++) to multiple files in cmd

I have been searching it, but I cant manage to found the way. Basically I have two files: "hello.txt" and "bye.txt":

hello.txt:

1 2 3 8 8

bye.txt:

9 9 8 1 2

I know how to redirect cin to hello.txt using:

a.exe < hello.txt

So cin will recieve "1 2 3 8 8". But how can I make it to recieve info from both files "1 2 3 8 8 9 9 8 1 2". I have already tried to duplacate the <:

a.exe < hello.txt < bye.txt

But it didnt work, I also tried this:

a.exe < hello.txt <& bye.txt

But from what I read it wont work (It didnt). Any ideas? Thanks

Answers


It is not relevant to C++. Either you could change the code and read from many files provided as command line or you redirect first all files in one and read that one then:

type hello.txt > tmp.txt
type bye.txt >> tmp.txt
e.exe < tmp.txt

Need Your Help

VS2012 Add Service Reference not updating config file

c# .net .net-4.5 service-reference

I have created a new IIS hosts WCF service using the webHttpBinding which is currently running on on IIS Express on my development machine and when I try to "Add Service Reference" the service is

Why I'm not being registered as a client?

c# unity3d network-programming

As far as I know Network.isClient should return true when I am connected to a server, specifically on a Unity MasterServer. But it does not.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.