悉野小楼

导航

上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页

2023年8月30日

二叉堆例子

摘要: 参考: https://blog.csdn.net/lyqzzy/article/details/59849252 https://baike.baidu.com/item/二叉堆 二叉堆是一种特殊的堆,二叉堆是完全二元树(二叉树)或者是近似完全二元树(二叉树)。 二叉堆有两种:最大堆和最小堆。最大 阅读全文

posted @ 2023-08-30 19:20 悉野 阅读(3) 评论(0) 推荐(0) 编辑

2023年8月27日

cocos creator使用用vscode调试

摘要: 1.vscode 安装 JavaScript Debugger (Nightly) 2.修改launch.json里面端口的值 端口号是cocos creator运行打开网页的端口号, vscode launch.json修改好后, 保存, 按F5就要吧启动调试了, 原typescript文件里面打 阅读全文

posted @ 2023-08-27 19:47 悉野 阅读(686) 评论(0) 推荐(0) 编辑

2023年8月26日

[转]C++使用虚函数的时候,子类也要使用virtual关键字吗

摘要: 原文地址:https://blog.csdn.net/gao1440156051/article/details/45670715 父类使用虚函数是为了让子类重写,那子类重写的时候也需要带virtual关键字吗?比如:class Base{virtual bool init();};class De 阅读全文

posted @ 2023-08-26 15:11 悉野 阅读(23) 评论(0) 推荐(0) 编辑

2023年8月25日

一个引用没效果错误示范

摘要: #include <iostream> #include <unordered_map> using namespace std; class TestClass { public: std::unordered_map<int, int>& GetData() { return m_data; } 阅读全文

posted @ 2023-08-25 18:59 悉野 阅读(3) 评论(0) 推荐(0) 编辑

c++ stl std::sort使用例子

摘要: 例子1: class User { public: int32_t m_fight_power; private: int32_t m_level; }; bool CenterData::compare(const User *left, const User *right) { if(left- 阅读全文

posted @ 2023-08-25 10:15 悉野 阅读(15) 评论(0) 推荐(0) 编辑

2023年8月24日

C++11 四种强制类型转换的区别

摘要: static_cast: 指针强转, 如果某个基类有多个子类, 基类的指针实际是指向A类的对象, 但使用强转为B类对象, 运行时会报错, 静态强转没做检测dynamic_cast: 只能用于虚函数类, 子类与父类指针互转, 会检测, 转换失败为返回空, 不会崩const_cast: 用于转换常量, 阅读全文

posted @ 2023-08-24 20:17 悉野 阅读(139) 评论(0) 推荐(0) 编辑

自定义游戏服务端时间 C++ 11实现

摘要: 原理: 系统已运行时间是不断增长的, 用户修改系统自带的时钟, 这个值不会变. 利用这个固定值加上自定义的时间长度, 计算出当前时间. C++ 98, windows使用 GetTickCount64()取固定时间, linux使用clock_gettime(CLOCK_MONOTONIC, &tp 阅读全文

posted @ 2023-08-24 10:11 悉野 阅读(20) 评论(0) 推荐(0) 编辑

2023年8月11日

[转]c++ function使用方法

摘要: 原帖:https://blog.csdn.net/myRealization/article/details/111189651 cppreference https://en.cppreference.com/w/cpp/utility/functional/function boost源码剖析之 阅读全文

posted @ 2023-08-11 20:59 悉野 阅读(45) 评论(0) 推荐(0) 编辑

C++多线程不加锁操作同一个整数

摘要: #include <iostream> #include <thread> #include <vector> #include <chrono> #include <atomic> using namespace std; int num = 0; //volatile int num = 0; 阅读全文

posted @ 2023-08-11 14:41 悉野 阅读(83) 评论(0) 推荐(0) 编辑

2023年8月8日

[go]学习笔记1

摘要: package main import "fmt" //全局变量不使用, 不报错, 局部变量会 var n1 = 1 var n2 = 2 var ( n3 = 3 n4 = "netty" ) var abc uint = 15 // ab := 3 //non-declaration state 阅读全文

posted @ 2023-08-08 15:35 悉野 阅读(5) 评论(1) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页