#ifndef EMP_H
#define EMP_H
#include <string>
struct menuEntry
{
string uID; //error: 'string' does not name a type
string uName; //error: 'string' does not name a type
};
#endif//EMP_H
‘string’ does not name a type 今天写代码有一次遇见这错误!虽然不是第一次遇见了,但还是耽误了一小会,为了不再耽误时间,所以把错误写下
示例理解:
|
|
|
|
也可以直接加上命名空间 using namespace std;
别忘了包含头文件<string>