Error C2664: 'strcpy' : cannot convert parameter 2 from 'const wchar_t [9]' to 'const char *'.How to solve this error?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I get rid of this error and other while compiling the below code? #include "stdafx.h" #include <string> #include <vector> #include <windows.h> #include <atlstr.h> #include <tchar.h> #include <stdio.h> #define MAX_PATH_LENGTH 256 int main(int argc, char *argv[]) { int i; char path[300]; bool FindFilesFromFolder(); getchar(); return 0; } bool FindFilesFromFolder() { HANDLE hFile; WIN32_FIND_DATA FindFileData; std::vector<char> fileList; char chFolderpath[_MAX_PATH]; CString strExtension = _T("*.B11"); strcpy(chFolderpath, _T("F:\\test\