Interview Question
Country: United States
Interview Type: In-Person
This is because ostream_iterator is taking the input as int. So, the value 200.2 becomes 200 during the iterator run.
yes, if we change the code to ostream_iterator<double>, it also prints out 200+200+200+, because the foo returns int
200+200+200+
- mridul November 03, 2011