![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
关于C++的错误
weixin_46060711
c/c++
展开
-
vector的陷阱
代码示例:#include <iostream>#include <vector>using namespace std;class Man {public: Man() {} void getPlay() { //玩一次喝十杯酒 count += 10; cout << "I'm playing..." << endl; } int getCount() { return count; }private: int原创 2022-01-24 16:28:32 · 405 阅读 · 0 评论 -
C++中:无法访问 private 成员
#include <iostream>#include <string>#include <Windows.h>using namespace std;//定义“人类”class Human {public: //公有的, 公共的 void eat(); //类里面的方法,又称为成员函数 void sleep(); void work(); void play(); string getName(); int getAge(); int g原创 2021-12-30 16:03:53 · 2269 阅读 · 5 评论