目录
1、创建LinkString.cpp文件
#include <stdio.h>
#include <malloc.h>
#define MaxSize 100
typedef struct node{
char data;
struct node *next;
}LinkString;
//串赋值运算
void Assign(LinkString *&s,char str[]){
int i=0;
LinkString *p,*tc;
s=(LinkString *)malloc(sizeof(LinkString));
tc=s;
while(str[i]!='\0'){
p=(LinkString *)malloc(sizeof(LinkString));
p->data=str[i];
tc->next=p;tc=p;
i++;
}
tc->next=NULL;
}
//输出串运算
void DispStr(LinkString *s){
LinkString *p=s->next;
while(p!=NULL){
printf("%c",p->data);
p=p->next;
}
printf("\n");
}
2、创建ComeCount.cpp文件
#include "LinkS