我收到错误: 标识符“ string”未定义。
但是,我包含了 string.h,在我的主文件中,一切正常。
密码:
#pragma once
#include <iostream>
#include <time.h>
#include <string.h>
class difficulty
{
private:
int lives;
string level;
public:
difficulty(void);
~difficulty(void);
void setLives(int newLives);
int getLives();
void setLevel(string newLevel);
string getLevel();
};
有人能解释一下为什么会这样吗?