Hi, why isn't this code is copying the file a.txt correctly?
int main()
{
ifstream input("C://Users//Me//Desktop//a.txt");
input.seekg (0, ios::end);
int length = input.tellg();
input.seekg (0, ios::beg);
while(true)
{
char* buffer = new char[length];
input.read(buffer, length);
ofstream output("C://Users//Me//Desktop//b.txt");
output.write(buffer, length);
break;
}
return 0;
}
I attached a.txt and b.txt in a .zip file