
C++学习记录
大狮熊
Just do it!
展开
-
数据结构KMP算法配图详解(超详细)
记录转载 2022-04-11 10:46:11 · 106 阅读 · 0 评论 -
KMP算法实现
学习记录原创 2022-04-11 10:43:41 · 116 阅读 · 0 评论 -
动态增长数组的实现
动态增长数组的实现: 完整代码如下: #include <stdio.h> #include <stdlib.h> #include <stdint.h> //Dynamically growing array to save ip address unsigned int current_element = -1; unsigned int total_element = 10; uint32_t* dynamic; uint32_t* ptr; int mai.原创 2021-11-13 19:03:46 · 573 阅读 · 0 评论 -
C++学习记录之string属性
resize(); 截断字符串 在vs2015编译器上默认容量大小为:当字符小于15个,申请15个容量(至少申请15个), 当大于15个满足关系式:15+n*16(n=字符数-15) vc6.0情况如图 我用的是Linux下的g++编译器(版本为2009),但我的容量始终输出为0,这是为啥呢? 代码: #include<iostream> using namespac...原创 2018-08-30 23:22:07 · 256 阅读 · 0 评论 -
C++学习记录之string输出
代码: #include<iostream> using namespace::std; int main(void) { string str("abcdefg"); cout << str << endl; cout << str.c_str() << endl; cout << str[0] <原创 2018-08-30 23:59:40 · 251 阅读 · 0 评论 -
C++学习记录之string修改
指定元素的修改 代码: include<iostream> #include<string> using namespace::std; int main(void) { string str; str=("abcdefg"); str[2]='s'; str.at(3)='q'; str.insert(5,"sadfk"); cout << s...原创 2018-09-01 15:16:26 · 308 阅读 · 0 评论 -
C++学习记录之string操作函数
代码: #include<iostream> #include<string> using namespace::std; int main(void) { string str1 = ("abcccccdefg"); string str2 = ("abc"); char STR[7] = {0}; cout << (str1 > str2) &l...原创 2018-09-01 18:33:39 · 138 阅读 · 0 评论