会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zq爱生活爱代码
博客园
首页
新随笔
联系
订阅
管理
随笔分类 -
C++
C++ string 截取 函数
摘要:截取字符串 //从string 拷贝操作 string str = "0123456789"; string str2 = str.substr(3, 5);//值拷贝 偏移位置,长度 str2 = str.substr(3);//从偏移位置拷贝到最后 //从char指针拷贝 char *c = "
阅读全文
posted @
2022-03-11 11:52
zq爱生活爱代码
阅读(1003)
评论(0)
推荐(0)
定义了#define NDEBUG ,assert 还生效 的处理方法
摘要:正常使用的话,必须导入 #include <assert.h>,这样才能在后面使用断言 如果要使断言失效,就必须在assert.h前面新增 NDEBUG,注意!!!!必须紧随上面新增,跨行都不行 #define NDEBUG#include <assert.h>
阅读全文
posted @
2022-02-17 08:45
zq爱生活爱代码
阅读(104)
评论(0)
推荐(0)
公告