#include<haker.h> 2023-06-04 00:38 采纳率: 40%
浏览 57
已结题

[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;

  • 写回答

3条回答 默认 最新

  • 今夕何夕2112 2023-06-04 11:36
    关注

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

    本回答被专家选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 6月15日
  • 专家已采纳回答 6月7日
  • 创建了问题 6月4日