首页 > TAG信息列表 > HString
堆串
1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 typedef struct 6 { 7 char* ch; 8 int len; 9 }HString; 10 11 void Assign(HString* A, const char* a);//赋值串 12 void Put(HString* A);串的堆式存储相关操作
#include<stdio.h> #include<stdlib.h> #include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define N 100 #define MAXSIZE 100 typedef int Status; typedef char ElemType; typedef struct { char *ch;//若是C语言字符串的拼接和暴力匹配
//动态存储字符串 (堆分配) #include <stdio.h> #include <stdlib.h> typedef struct { char *ch; int length; }HString; //初始化 HString* InitString() { HString* str = (HString *)malloc(sizeof(HString)); str->ch = NULL; str->length =