![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串类
牟林伟
我们都要好好的!
展开
-
字符串类简单处理
这就直接上代码吧! `class MyString { char s; int len;//除了结束符的长度 public: MyString(); MyString(const char* c); MyString(int c); MyString(const MyString& that); ~MyString(); void add(int a); void add(const ch...原创 2018-11-04 16:50:42 · 116 阅读 · 0 评论 -
字符串->交换
数组作为形参时会自动退化成指针。个人觉得很形象 #include<iostream> void ExchangeString(char* a,char*b)//(char a[],char b[]) { char tt[128]; char pp[128]; strcpy(tt,a); strcpy(pp,b); strcpy(a,pp); strcpy(b,tt);...原创 2018-11-22 17:29:42 · 294 阅读 · 0 评论 -
一些小方法诸如:交换值,排序,查找等等
#include<iostream> #include<windows.h> //#include"c:\Users\Administrator\Desktop\dd\aaa.h" //------strlen 没有结束符,sizeof 有结束符 int a = 1; int b = 2; int arr[] ={1,2,6,4,8,9,11,55,23}; int mu...原创 2018-12-19 19:00:10 · 179 阅读 · 0 评论