mirror of
https://github.com/happyflyer/wangdao-data-structure.git
synced 2026-05-01 06:01:41 +08:00
完成串
This commit is contained in:
21
ch4/sequence_dynamic.cpp
Normal file
21
ch4/sequence_dynamic.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define MAXLEN 255
|
||||
typedef struct
|
||||
{
|
||||
char *ch;
|
||||
int length;
|
||||
} HString;
|
||||
|
||||
void InitString(HString &S)
|
||||
{
|
||||
S.ch = (char *)malloc(MAXLEN * sizeof(char));
|
||||
S.length = 0;
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
HString S;
|
||||
InitString(S);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user