HP Integrity NonStop H-Series User Manual
Page 33
Advertising

values from a vector into the standard output, and separates each value by a space:
copy (newdata.begin(), newdata.end(),
ostream_iterator<int> (cout, " "));
Simple file transformation algorithms can be created by combining input and output stream
iterators and the various algorithms provided by the standard library. The following short
program reads a file of integers from the standard input, removes all occurrences of the value 7,
and copies the remainder to the standard output, separating each value by a new line:
void main()
{
istream_iterator<int, ptrdiff_t> input (cin), eof;
ostream_iterator<int> output (cout, "\n");
remove_copy (input, eof, output, 7);
}
Advertising
This manual is related to the following products: