I have a function:
BOOL ReadWebPage(CONST TCHAR *sURL, TCHAR *sDataRead)
{
BOOL rv = FALSE
TCHAR *sFile = new TCHAR[1024]();
StringCchCopy(sFile, 1024, L"c:\\temp\\file.txt");
res = URLDownloadToFileW(NULL, sURL, sFile, 0, NULL);
if (res != S_OK)
StringCchCopy(sDataRead, 16, L"Error");
else {
StringCchCopy(sDataRead, 16, L"File exists on remote server");
rv = TRUE; }
delete[] sFile;
return rv;
}
If it's *sDataRead
, then the calling line would call this function like this:
ReadWebPage(L"http://www.example.com/test.txt", sTest);
If it's **sDataRead
, then the calling line would call this function like this:
ReadWebPage(L"https://www.example.com/test.txt", &sTest);
My question is, should I make the declaration in the function for ReadWebPage
as it is, *sDataRead
, or is it more efficient to declare it as **sDataRead
, or does it not make any difference?