Reply to comment

I hope this was just an

I hope this was just an example of using iterators, since copying files can be done much simpler:

#include <fstream>
using namespace std;
int main()
{
  ifstream f1("input.txt", fstream::binary);
  ofstream f2("output.txt", fstream::trunc|fstream::binary);
  f1 << f2.rdbuf();
}

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post PHP code. You should include <?php ?> tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.