1.引入头文件#include<string.h>ios
2.字符串函数的介绍数组
经常使用的几个函数以下所示:
url
strlen求字符串长度spa
strcmp比较2个字符串是否同样htm
strcat字符串链接操做ip
strcpy字符串拷贝操做内存
strncat字符串链接操做(前n个字符)字符串
strncpy字符串拷贝操做(前n个字符)get
strchr查询字串
strstr 查询子串
附:引用头文件
#include <assert.h> //设定插入点
#include <ctype.h> //字符处理
#include <errno.h> //定义错误码
#include <float.h> //浮点数处理
#include <fstream.h> //文件输入/输出
#include <iomanip.h> //参数化输入/输出
#include <iostream.h> //数据流输入/输出
#include <limits.h> //定义各类数据类型最值常量
#include <locale.h> //定义本地化函数
#include <math.h> //定义数学函数
#include <stdio.h> //定义输入/输出函数
#include <stdlib.h> //定义杂项函数及内存分配函数
#include <string.h> //字符串处理
#include <strstrea.h> //基于数组的输入/输出
#include <time.h> //定义关于时间的函数
#include <wchar.h> //宽字符处理及输入/输出
#include <wctype.h> //宽字符分类