At first sorry about my English.
Im preparing for my exam and I need to practice iterators, that don
t work with containers.
I would like to input some symbols right to the symbol like '\n' and I have no clue how can I do that.
The problem is I am not able to stop entering symbols.
Hope you can help me.
Sincerely thank you!
#include <iostream>
#include <iterator>
#include <algorithm>
#include <fstream>
using namespace std;
int main()
{
ofstream out("name.txt");
istream_iterator<char> it(cin);
istream_iterator<char> end_of_stream;
ostream_iterator<char> fout(out, " ");
copy (it, end_of_stream, fout);
}