5
Contributors
7
Replies
8
Views
8 Years
Discussion Span
Last Post by Freaky_Chris
0

Or simply?

#include <windows.h>

int main()
{
  CopyFile( "source", "destination", true );
}

Providing your developing on a windows machine and want unportable code.

0

>Providing your developing on a windows machine and want unportable code.
Fair enough ;)

#include <fstream>

int main()
{
  std::ifstream in( "source", std::ios::in );
  std::ofstream out( "target", std::ios::out );
  out << in.rdbuf();
}

Shortest portable way I can think of.

0

>Providing your developing on a windows machine and want unportable code.
Fair enough ;)

#include <fstream>

int main()
{
  std::ifstream in( "source", std::ios::in );
  std::ofstream out( "target", std::ios::out );
  out << in.rdbuf();
}

Shortest portable way I can think of.

fair enough, now all thats leftfor me to pull you up on is your lack of a return :D

Chris

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.