Hello, writing a program I found a small error in reading double. Why if I don't write a double value using dot notation (2.5) but using the comma (2,5) numbers after the decimal point are truncated?
for example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
int main()
{
double val1 = 0;
double val2 = 0;
cout << "Please enter two floating point value : ";
cin >> val1 >> val2;
if (val1 > val2)
cout << val1 << " is bigger than " << val2 << "\n\n";
if (val1 < val2)
cout << val2 << " is bigger than " << val1 << "\n\n";
return 0;
}
If I enter the value 2,3 2,4 the get truncated ? why the output is : 2 is bigger than 0 ? why the computer didn't read the second number into val2 ?
I'm just a beginner