‘string’ does not name a type 错误解析
来源:互联网 发布:夏天乳液推荐 知乎 编辑:程序博客网 时间:2024/05/06 22:52
‘string’ does not name a type 今天写代码有一次遇见这错误!虽然不是第一次遇见了,但还是耽误了一小会,为了不再耽误时间,所以把错误写下
示例理解:
#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
#ifndef EMP_H #define EMP_H #include <string> struct menuEntry { std::string uID; /* ok */ std::string uName; /* ok */ }; #endif//EMP_H
也可以直接加上命名空间using namespace std;
别忘了包含头文件<string>
- ‘string’ does not name a type 错误解析
- ’string‘ does not name a type
- error: ‘string’ does not name a type string name;
- 由“error string in namespace std does not name a type”错误引发
- string' does not name a type 及命名空间
- `QtValidLicenseForCoreModule' does not name a type 错误的解决
- ptrdiff_t does not name a type造成编译错误
- C++ - 错误"error: 'off64_t' does not name a type"
- ndk编译错误:error: 'override' does not name a type
- std::string VS string 和 error:'string' does not name a type
- error :does not name a type
- c++ class does not name a type
- error: ‘ptrdiff_t’ does not name a type
- 'int32_t' does not name a type
- error: 'uid_t' does not name a type
- error: ‘ptrdiff_t’ does not name a type
- error: ‘ptrdiff_t’ does not name a type
- c++ class does not name a type
- Change Host Name or Port Num in R12 EBS
- VI命令
- web.xml里<filter-mapping>中的<dispatcher>作用
- 打印杨辉三角
- 一个简单的多线程
- ‘string’ does not name a type 错误解析
- Jpcap 网络抓包工具
- appfuse使用笔记
- 一步一步使用Ext JS MVC与Asp.Net MVC 3开发简单的CMS后台管理系统之用户管理(4)
- 自动化测试
- 做好一件事,让它有意义,不管回报,全力以赴
- Android 使用SQLiteDatabase操作SQLite数据库(二)
- EXCEL合并表
- 分布式java应用学习笔记一