For copying a file I've used this code:
#include <fstream>
int main()
{
std::ifstream file("C:/Kopia.dat");
std::ofstream file2("C:/KopiaAvKopia.dat");
int x = sizeof file;
char c[x];
file >> c;
file2 << c;
return 0;
}
The problem here is that the program only reads the first characters before a space comes from "file" into the "c"-array. Thus, it only copies those characters into "file2".
What I'm asking for is help with this copying process, so that it can copy everything from "file". I also would like the copied characters to be outputted in binary formate to "file2".