Answer the question
In order to leave comments, you need to log in
Error with c++ types?
Error when trying to pass a string containing the username of the computer owner to the CopyFile() function
#include <iostream>
#include <locale>
#include <Windows.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "ru");
string username = getenv("username");
string fileName = "TestFile";
CopyFile("C:\\Users\\"+username+"\\Desktop\\" + fileName + ".txt", "E:\\" + fileName + ".txt");
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question