I'm reading in float number from text file.
here is the code:
using namespace std;
main(int argc, char *argv)
while (cin >> i)
//debug -- print out elements of vector
cout<< N[x] << "\n ";
In the text file, the floats are up to 6 decimal digits.(ie, 4.563424, 2.532190) But when I print out the float by cout, it rounds up to 3 decimal digit and prints it out. (ie 4.564, 2.532)
Why is it doing this? Does this mean, it's getting stored in the vector like this? or it's just a limitation of "cout"? Is there a way of getting around this(whether it's storage limition or i/o limitation)?