随笔分类 -  C++

摘要:截取字符串 //从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)
摘要:正常使用的话,必须导入 #include <assert.h>,这样才能在后面使用断言 如果要使断言失效,就必须在assert.h前面新增 NDEBUG,注意!!!!必须紧随上面新增,跨行都不行 #define NDEBUG#include <assert.h> 阅读全文
posted @ 2022-02-17 08:45 zq爱生活爱代码 阅读(104) 评论(0) 推荐(0)