A
andreas.fabri
I have a problem reading integers separated by commas with VC8
This program:
___________________________
// read.C
#include <iostream>
int main()
{
int n;
std::cin >> n;
std::cout << "n = " << n << std::endl;
}
____________________________
and this input in a file data.txt:
__________________________
1,2
4
__________________________
and run like that: read.exe < data
produces as output
n = 2015115236
When adding a blank before the comma
everything is fine.
Is this a VC8 bug, or is this standard compliant
and Microsoft the spearhead of the compliance front.
andreas
This program:
___________________________
// read.C
#include <iostream>
int main()
{
int n;
std::cin >> n;
std::cout << "n = " << n << std::endl;
}
____________________________
and this input in a file data.txt:
__________________________
1,2
4
__________________________
and run like that: read.exe < data
produces as output
n = 2015115236
When adding a blank before the comma
everything is fine.
Is this a VC8 bug, or is this standard compliant
and Microsoft the spearhead of the compliance front.
andreas