Community
Participate
Working Groups
I'm trying to use the option to redirect the standard inout from a file but the code wait for a input from the console... How does this feature work? -- Configuration Details -- Product: Eclipse 4.5.1.20150917-1200 (org.eclipse.epp.package.cpp.product) Installed Features: org.eclipse.platform 4.5.1.v20150904-0015
Have you used the options in "Common" tab of Run/Debug Configurations Dialog ?
Sure! from the console, no problem to get the input. When I flag the option to use the file and navigate through the file system (not the workspace button because i know there a problem with format of the string in the file name textbox) the software runs but wait for an input and if i enter it in the console it accept the input and the code proceed with the next instruction. If I uncheck the console checkbox it waits forever... (In reply to Sarika Sinha from comment #1) > Have you used the options in "Common" tab of Run/Debug Configurations Dialog > ?
(In reply to federico bianchi from comment #2) If I uncheck the console checkbox it waits forever... Yes , If we uncheck the console checkbox, we cannot provide an input from console. I think we can close this as Works as expected ?
(In reply to Sarika Sinha from comment #3) > (In reply to federico bianchi from comment #2) > If I uncheck the console checkbox it waits forever... > > > > Yes , If we uncheck the console checkbox, we cannot provide an input from > console. > > I think we can close this as Works as expected ? what if i want the input from a file?
For that We have a separate check box, Input File.
Ok. Go back and Read my secondo message above... (In reply to Sarika Sinha from comment #5) > For that We have a separate check box, Input File.
Can you please attach a sample program and input file, with which you are facing problem ?
(In reply to Sarika Sinha from comment #7) > Can you please attach a sample program and input file, with which you are > facing problem ? Sorry for the late answer, I was away. Here the code I'm using: #include <iostream> #include <cstdlib> using namespace std; int main(int argc, char *argv[]){ if(argc != 2) { cout << "Usage: " << endl; cout << " mergesort" << endl; cout << " legge da stdin i valori numerici (int) da ordinare (max 10^4), uno per riga" << endl; cout << " produce in output la sequenza ordinata" << endl; exit(1); } const int MAX_SIZE = 10000; int array[MAX_SIZE]; int size = 0; while((size < MAX_SIZE) && (cin >> array[size++])) ; if(cin.eof()) size--; for(int i = 0; i < 7; i++) { cout << array[i] << endl; } return 0; } then I have a file "array.txt" with just some number in it.
Hi Federico, Thanks for the patience. So if there is no console, we should redirect it to a output file if we want to see the output. As there is no console assigned, you can't see the output there. Let me know if it helps.