mirror of
https://github.com/happyflyer/wangdao-data-structure.git
synced 2026-05-03 09:49:56 +08:00
完成串
This commit is contained in:
25
ch4/link.cpp
Normal file
25
ch4/link.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
typedef struct StringNode
|
||||
{
|
||||
char ch;
|
||||
struct StringNode *next;
|
||||
} StringNode, *String;
|
||||
|
||||
bool InitString(String &S)
|
||||
{
|
||||
S = (StringNode *)malloc(sizeof(StringNode));
|
||||
if (S == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
S->next = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
String S;
|
||||
InitString(S);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user