"Severin Ecker" <se****@gmx.at> wrote in message news:3f***********************@aconews.univie.ac.a t...
hi!
i'm trying to copy a file with the std::copy function but my problem is,
that whitespaces are discarded. could anyone tell me how i can just copy all
the characters that are in the source-file. thx.
std::istream_iterator<std::string> ins(in), eos;
std::ostream_iterator<std::string> outs(out);
std::copy(ins, eos, outs);
You can have the ostream_iterator output a separator if you give it a second
arg:
std::ostream_iterator<std::string> outs(out,'\n');
Do you really want to be doing formatted I/O?
If you want to literally copy the file, it's probably better to use use a loop of
read/write combintations (or getline at the worst).