阅读背景:

第八周实践项目~建立顺序串的算法库

来源:互联网 

sqstring.h头文件代码:

#ifndef SqString_H_INCLUDED
#define SqString_H_INCLUDED


#include <stdio.h>
#include <malloc.h>
#define MaxSize 100             //最多的字符个数
typedef struct
{   char data[MaxSize];         //定义可容纳MaxSize个字符的空间
    int length;                 //标记当前实际串长
} SqString;


void StrAssign(SqString &s,char cstr[]);    //字符串常量cstr赋给串s
void StrCopy(SqString &s,SqString t);   //串t复制给串s
bool StrEqual(SqString s,SqString t); //判串相等
int StrLength(SqString s);  //求串长
SqString Concat(SqString s,SqString t);  //串连接
SqString SubStr(SqString s,int i,int j); //求子串
SqString InsStr(SqString s1,int i,SqString s2); //串插入
SqString DelStr(SqString s,int i,int j) ;   //串删去
SqString RepStr(SqString s,int i,int j,SqString t);     //串替换
void DispStr(SqString s);   //输出串
#endif // SqString_H_INCLUDED
#ifndef SqString_H_INCLUDED



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: