Let's say I have the following C++ Code
#include <iostream>
int main()
{
int x,y;
std::cout << "Please enter the first input." << std::endl;
std::cin>>x;
std::cout << "Please enter the second input." << std::endl;
std::cin>>y;
std::cout<<x/y<<std::endl;
return 0;
}
I can compile the file from command line with cl/EHsc sample.cpp
what i want to do is to display the output(s) of the program with inputs given from the command line.How can i do this?
x should get it's value from the first command line argument,
y should get it's value from the second command line argument.
Following should work but i want to avoid fiddling with Visual Studio Properties etc.
Piping input into a c++ program to debug in Visual Studio
Edit: Also for further clarification i want to use it as an automated system where it receives the input from the command line and I do not want to modify the original code