I want to execute in Code::blocks IDE program providing standard input.
Say
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a;
double b;
cout << "Side one\n";
cin >> a;
cout << "Side two\n";
cin >> b;
cout << "Result :" << sqrt(a*a + b*b) << endl;
}
With arguments "a" and "b" , provided in file:
Say:
2 4
I could do that in bash, compiling and then:
"./my_compiled_program < ./myinput"
I simply want to have, file with argument (standard input) in code::blocks.
How can I do this?
PS: The "set program's arguments" unfortunately don't works
Thanks to @aleguna:
We should make file in folder where is the file we want to compile and execute:

And then add the < ./input to program arguments, where input is the name of file we placed next to source code.

Thank you @aleguna.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With