Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file as stdin in C in command line in visual studio

When I write a C program and compile it using a standalone compiler, such as MinGW, I can write "myprogram.exe < test.txt" and the standard input is test.txt.

How can I do that in Visual Studio 2010? I'm aware of "Command Arguments" in Project properties and then debugger, but I don't know what to type there. Is it just the path of the input file or something else?

like image 758
Anonymoose Avatar asked May 16 '11 17:05

Anonymoose


1 Answers

Visual Studio does support this use-case. For your C++ project, go to properties, Configuration Properties, Debugging, and in Command Arguments type "< test.txt".

like image 115
Gadzair Avatar answered Nov 15 '22 11:11

Gadzair