- 博客(6)
- 收藏
- 关注
原创 VMware Ubuntu20.04虚拟机安装
镜像下载 https://blog.youkuaiyun.com/weixin_45912291/article/details/108900602 安装 https://blog.youkuaiyun.com/weixin_45912291/article/details/108901106 中文输入法安装 https://blog.youkuaiyun.com/a805607966/article/details/105874756
2022-05-26 00:03:58
148
原创 C++无法在头文件中定义string类数据
//头文件中不仅要包含<string>,也要加上命名空间 //.h文件 #include <string> using namespace std; //或者使用 //std::string
2020-05-03 21:08:11
3564
8
原创 E0304 C2660 "strcpy_s"
C++ VS2017 1.E0304 没有与参数列表匹配的 重载函数 “strcpy_s” 实例 2.C2660 “strcpy_s”: 函数不接受 2 个参数 char* s = "hello"; char* str; //动态分配内存提示错误 str = new char[10]; strcpy_s(str,s); //报错 不接受2个参数 //改为以下形式 strcpy_s(str,s...
2020-04-09 21:27:33
3775
原创 error C2597: 对非静态成员的非法引用
静态成员函数只能访问静态成员变量 class Person { public: //int m_Cnt; //错误C2597 static int m_Cnt; static void addCnt(int cnt) { m_Cnt += cnt; } }; int m_Cnt = 0;
2020-03-19 14:54:38
6401
原创 error C4430: 缺少类型说明符
在类外初始化要加数据类型 class Person { static int m_Age; }; //Person::m_Age = 0; //错误C4430 int Person::m_Age = 0;
2020-03-19 14:52:52
308
原创 error C2864: 只有静态常量整型数据成员才可以在类中初始化
静态成员变量要在类外初始化 class Person { public: //错误C2864 //static int m_Age = 0; static int m_Age; }; int Person::m_Age = 0;
2020-03-19 14:48:46
2024
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅