Hi!
I just upgraded to win 7 64 bit.
I have tryed it both on cygwin compiler and MinGW compiler (toolchain)
Working on eclipse.
My code works perfect in Linux/ubuntu environment but running in win 7 environment I have the following problem.
My last cin does not work. The input is not fetched. At every "enter" it promts me for a new value. Nothing is fetched and cin continues to loop requesting new values ( but just for the last cin).
I have 4 cin requesting input values according as described in the code below.
string Configuration::fetchManInput ( string text1, string valueRange, string defaultValue)
{
string checkDataOk;
checkDataOk = "no";
string input;
input = "none";
while (checkDataOk != "y")
{
cout << "
cout << text1 << " \n";
cout << " value range:> " << valueRange << " \n";
cout << "> ";
cin >> input ;
if ( input == "d")
{
input = defaultValue;
}
cout << "You set it to > " << input << "\n";
cout << " ok ?.... if yes print y " << "\n";
cout << "> ";
cin >> checkDataOk;
}
return input;
}
And
string Configuration::readDeviceName()
{
string deviceName;
string ans("");
cout << "ana= " << ans << "\n";
deviceName = " ";
string input(" ");
while (ans != "y")
{
// Start up function
cout << " Name the Device ex Sprinkler1 \n";
cout << "> ";
cin >> deviceName;
cout << " ok ? if yes print y \n";
cin >> ans;
}
return deviceName;
}
Both those methods are called after each other.
The execution looks as follows
------
Do you want to run in test mode ? Default (d) is 'on'
value range:> on/off
> d
You set it to > on
ok ?.... if yes print y
> y
TestModeStatus= > set
========================================================
test1
ana=
Name the Device ex Sprinkler1
> fff
Size devicename= 3
You named it > fff
ok ? if yes print y
> y ....here I gave a y and hit enter
... .... ....here I hit enter
... .... ....here I hit enter
... .... ....here I hit enter
y ....here I gave a y and hit enter
y ....here I gave a y and hit enter
-------
as you can see its just looping.
If I cansel the execution it will continue to run the full application.
Please help.. I am going nuts about it!! I have tryed almost annything. Where is the fault. Obviously it has something to do with windows.
Gunnar