TCHAR end of line character
int DownloadFtpDirectory(TCHAR* DirPath) {
WIN32_FIND_DATA FileData;
UINT a;
TCHAR* APP_NAME = TEXT("ftpcli");
TCHAR* f;
int j = 5;
do {
j++;
f = _tcsninc(DirPath, j);
}while (_tcsncmp(f, TEXT("/"), 1));
TCHAR* PATH_FTP = wcsncpy(new TCHAR[j], DirPath, j);
A开发者_如何学Pythonfter the last line gets a string in which there is no line ending character, how to fix this? P.S. how to do so would be out of line "ftp://ftp.microsoft.com/bussys/", get a string ftp.microsoft.com if both strings are TCHAR ?
TCHAR* PATH_FTP = wcsncpy(new TCHAR[j+1], DirPath, j);
PATH_FTP[j] = TEXT('\0');
精彩评论