c++
u014288927
这个作者很懒,什么都没留下…
展开
-
C++ : 对一个字符串按照特定字符切割
对一个字符串(::192:168:ABC::416)按照特定字符(:)切割#include <iostream>#include <vector>#include<string>#include<sstream>#include<algorithm>using namespace std;vector<strin...原创 2018-09-09 21:07:44 · 8890 阅读 · 0 评论 -
C++ : 在一个string字符串中查找给定的字符串并提取
C++ : 在一个string字符串中查找给定的字符串并提取1、string.find_last_of('\\'); // 返回类型 size_t 2、string.find_first_of(' '); // 返回类型 size_t 3、string.substr(size_t a,size_t b) //位置a , 位置b;提取中间字符串4、string.find...原创 2018-09-09 22:10:47 · 34739 阅读 · 0 评论 -
C(C++) memmove和memcpy的实现以及区别所在(以及与strcpy的简单对比)
memcpy和memmove()都是C语言中的库函数,在头文件string.h中,作用是拷贝一定长度的内存的内容,原型分别如下: void *memcpy(void *dst, const void *src, size_t count); 描述: memcpy()函数从src内存中拷贝n个字节到dest内存区域,但是源和目的的内存区域不能重叠。返回值: ...原创 2018-09-10 12:38:20 · 458 阅读 · 0 评论