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);
在最后一行获得一个没有行结束字符的字符串后,如何解决这个问题? 附:如何这样做将是“ftp://ftp.microsoft.com/bussys/”,如果两个字符串都是TCHAR,请获取字符串ftp.microsoft.com?
答案 0 :(得分:1)
TCHAR* PATH_FTP = wcsncpy(new TCHAR[j+1], DirPath, j);
PATH_FTP[j] = TEXT('\0');