![](https://img-blog.csdnimg.cn/direct/2a452773a8b04d6781bee6a83ee08ed3.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C/C++
深入探讨C++的各个方面,从语言基础到高级特性,从编程技巧到性能优化,力求为读者提供全面而深入的学习资源。通过这个专栏,让我们一起探索C++的奥秘,共同提升编程技能和思维能力。
极地星光
这个作者很懒,什么都没留下…
展开
-
如何在C++中实现延迟删除功能
在软件开发中,缓存是一种常见的优化技术,它允许我们存储数据以供快速访问,从而减少对慢速存储或网络资源的依赖。然而,有时我们可能希望缓存中的某些数据在一段时间后自动过期并被删除,这就是所谓的“延迟删除”功能。在C++中,实现这样的功能通常需要结合使用数据结构、时间戳和定时器或定期执行的任务。原创 2024-06-15 12:20:05 · 283 阅读 · 0 评论 -
程序性能分析:工具与策略
本文将介绍程序性能分析的策略以及一系列性能分析和内存检查工具。原创 2024-06-13 21:19:58 · 355 阅读 · 0 评论 -
C++ 类型转换
C++ 四种类型转换:static_cast, dynamic_cast, const_cast, reinterpret_cast原创 2024-05-08 22:08:00 · 339 阅读 · 1 评论 -
C++ 智能指针使用
智能指针使用:shared_ptr、weak_ptr、unique_ptr原创 2024-05-08 21:57:45 · 489 阅读 · 0 评论 -
STL--容器
总结各种容器的优缺点及应用场景;原创 2024-04-10 20:53:28 · 475 阅读 · 0 评论 -
【C++】获取当前时间戳
1.2 使用函数获取当前时间戳。1.1 获取代码运行时间。原创 2023-08-22 22:48:47 · 1158 阅读 · 0 评论 -
2D坐标变换
【代码】2D坐标变换。原创 2023-02-28 14:36:04 · 215 阅读 · 1 评论 -
基本图形的绘制与填充
【代码】基本图形的绘制与填充。原创 2023-02-28 14:26:41 · 196 阅读 · 0 评论 -
TCP通信(02)
TCP通信,客户端向服务端发送数据原创 2022-12-29 21:27:53 · 110 阅读 · 0 评论 -
TCP通信(01)
tcp通信,服务器端向客户端发送数据。原创 2022-12-29 15:52:21 · 85 阅读 · 0 评论 -
获取网络接口信息
获取网络接口信息原创 2022-12-29 08:58:08 · 138 阅读 · 0 评论 -
HTTP通信
通过网络访问接口实现HTTP通信原创 2022-12-28 20:40:37 · 91 阅读 · 0 评论 -
c++中的floor, ceil, round
2.1 2.6 -2.1 -2.6floor : 不大于自变量的最大整数 2 2 -3 -3ceil :不小于自变量的最小整数 3转载 2016-10-11 17:02:34 · 389 阅读 · 0 评论 -
个人银行账户管理程序实例
头文件class SavingAccount{public: SavingAccount(int date, int id, double rate); int getId(); double getBalance(); double getRate(); void show();//显示信息 void deposit(int date, doubl原创 2016-10-11 17:06:10 · 1895 阅读 · 0 评论 -
用conat修饰的类成员——常成员函数、常成员数据、常引用
#include #include using namespace std;class R{public: R(int r1, int r2):m_iR1(r1), m_iR2(r2){}//常成员在初始化列表中进行初始化。 R(const R &r);//常引用 void display() const;//常成员函数 void display();p原创 2016-10-14 17:04:16 · 543 阅读 · 0 评论 -
动态二维数组
#include #include using namespace std;class Point{public:Point(){cout Point(int x, int y):m_iX(x), m_iY(y){cout ~Point(){cout int getX(){return m_iX;}int getY(){return m_iY;}原创 2016-11-07 11:46:00 · 266 阅读 · 0 评论 -
对象的生存期——变量的生存期与可见性
#includeusing namespace std;int i=1;//i为全局变量,具有静态生存期void other(){//a、b是静态局部变量,具有静态生存期,局部可见。只第一次进入函数时被初始发。static int a=2;static int b;//c是局部变量,具有动态生存期。int c=10;a+=2;i+=32;c+=5;原创 2016-10-17 09:48:58 · 645 阅读 · 0 评论 -
类的友元
#include <iostream>#include <cstdlib>using namespace std;class Point{public:Point(int x, int y);friend float dist(Point &p1, Point &p2);private:int m_iX, m_iY;};Point::Po...原创 2019-05-04 14:38:51 · 93 阅读 · 0 评论 -
链队列——链式存储结构
#include #include using namespace std;//连队的结点struct Node{ int date; Node *next;};class Queue{public: Queue(); ~Queue(); bool EnQueue(int e); bool DeQueue(int &e); int G原创 2016-10-17 22:17:57 · 229 阅读 · 0 评论 -
数据结构二叉树——递归遍历
#include <iostream>#include <cstdlib>using namespace std;struct BinTreeNode{int date;BinTreeNode *liftChild, *rightChild;}class BinaryTree{public:BinaryTree();BinaryTre...原创 2019-05-04 14:38:36 · 409 阅读 · 0 评论 -
Runtime类
在每一个java应用程序中,都有唯一一个RunTime对象,该唯一的RunTime对象可通过getRunTime()方法获得。应用程序不能创建自己的RunTime队象,package e5_7;public class RunTimeDemo { public static void main(String[] args) { Runtime r = Runt原创 2016-10-20 16:48:49 · 229 阅读 · 0 评论 -
c++中常量的两种定义方式
常量是定以后,在程序运行中不能被改变的标识符。C++中定义常量可以用#define 、const 这两种方法。例如:#define PRICE 10 //定义单价常量10const int PRICE = 10; //定义单价常量10其实用常量是有它的理由的,下面我们来看下面两段程序对比代码#include using namespace std;#de原创 2016-10-10 09:53:27 · 8102 阅读 · 0 评论