会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小小林林
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
下一页
2022年4月24日
C++切除问题
摘要: C++中的 "override" - 简书 (jianshu.com) 1 #include <iostream> 2 3 using namespace std; 4 5 class Hum 6 { 7 protected: 8 string name; 9 public: 10 Hum(stri
阅读全文
posted @ 2022-04-24 14:14 小小林林
阅读(43)
评论(0)
推荐(0)
2022年4月22日
C++ 字符流使用
摘要: 1 #include <sstream> 2 3 int main() 4 { 5 std::ostringstream ostr; 6 ostr << "Test" << std::endl; 7 std::cout << ostr.str(); 8 }
阅读全文
posted @ 2022-04-22 17:20 小小林林
阅读(38)
评论(0)
推荐(0)
2022年4月21日
C++拷贝构造
摘要: 在类成员为基本类型情况下,编译器默认提供的拷贝构造函数直接进行值拷贝,是不存在深浅拷贝问题。 如下即使注释掉运算符重载 和 自己编写的拷贝构造函数,main 函数依然可以正常运行。 类成员非基本类型且不包含拷贝构造 和运算符重载功能,编译器直接进行值拷贝会出错;在指针情况下只会拷贝指针地址值,代码异
阅读全文
posted @ 2022-04-21 14:31 小小林林
阅读(49)
评论(0)
推荐(0)
2022年4月19日
模板传入vector 指针
摘要: 1 template<typename T> 2 void Tarray(std::vector<T>& tt) 3 { 4 tt.push_back(100); 5 } 6 std::vector<int> aa; 7 Tarray<int>(aa); 8 PDmsg(aa[0]); 9 PDms
阅读全文
posted @ 2022-04-19 18:02 小小林林
阅读(31)
评论(0)
推荐(0)
jsoncpp 两种方式写入配置文件
摘要: 1 bool ret = false; 2 3 //Json::FastWriter writer_ob; 4 //std::string jsonStr = writer_ob.write(root); 5 6 std::string jsonStr = root.toStyledString()
阅读全文
posted @ 2022-04-19 14:51 小小林林
阅读(116)
评论(0)
推荐(0)
2022年4月15日
C++使用定义静态类,禁止实例化&&继承程序示例(借助纯虚函数是的只能以类名访问属性和方法)
摘要: #include <iostream> using namespace std; class TestStatic final { public: static void PrintName() { cout << "Myname is test Statci class...." << endl;
阅读全文
posted @ 2022-04-15 15:06 小小林林
阅读(66)
评论(0)
推荐(0)
2022年4月13日
C++ 模板编程简单示例程序
摘要: template<typename T, int N> void Print(T value) { for(int i = 0; i < N; i++) cout << value << endl; } using namespace std; int main() { Print<string,
阅读全文
posted @ 2022-04-13 11:13 小小林林
阅读(251)
评论(0)
推荐(0)
C++虚基类 类接口应用示例程序
摘要: 1 #include <string> 2 3 using namespace std; 4 5 struct Sres 6 { 7 string content; 8 int value; 9 }; 10 11 class BaseABC 12 { 13 public: 14 BaseABC(st
阅读全文
posted @ 2022-04-13 11:07 小小林林
阅读(53)
评论(0)
推荐(0)
2022年4月11日
C++深拷贝浅拷贝示例程序
摘要: 1 #include <iostream> 2 3 class String 4 { 5 private: 6 char *m_BufMemPtr; 7 int m_BufSize; 8 9 public: 10 String(const char *srcbuf) 11 { 12 m_BufSiz
阅读全文
posted @ 2022-04-11 14:25 小小林林
阅读(52)
评论(0)
推荐(0)
2021年12月30日
ROS2 学习参考链接
摘要: (134条消息) 一文读懂“数据分发服务DDS”(Data Distribution Service,RTPS,OMG)_DDS_CSIT的博客-CSDN博客_dds ROS2 概念解释
阅读全文
posted @ 2021-12-30 11:19 小小林林
阅读(56)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告