Answer the question
In order to leave comments, you need to log in
How to add // to path instead of / in C++?
There are two questions about paths in C++
. I use two functions.
First:
With the help of it I get the path to the file where it lies and the program gives me the address
"C:\Folder\file.exe"
With the help of the second function, I get the file from the server and I want to place it at the location address that the first function receives.GetModuleFileNameA(NULL, szPath, MAX_PATH);
bool tool::downloadFile(string url, string filepath) {
DeleteUrlCacheEntry(url.c_str());
HRESULT hr = URLDownloadToFile(
NULL,
url.c_str(),
filepath.c_str(),
0,
NULL);
if (SUCCEEDED(hr))
return true;
else
return false;
}
Answer the question
In order to leave comments, you need to log in
Escaping slashes only makes sense in literals. If you're getting a string into a variable from a function, you don't need to worry about escaping.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question