[Error] 'string' was not declared in this scope

编译时报错:
[Error] 'string' was not declared in this scope

    char szPath[1000];
    GetModuleFileName(NULL, szPath, sizeof(szPath) - 1);
    string SzPath = szPath;
    LPCTSTR targetPath;
    struct _finddata_t fileinfo;
    long long fHandle;

注意是加#include不是#include<string.h>
然后不管有没有写using namespace std;
string改成std::string都可行

加上

#include <string>

改成 std::string 呢?