#include <stdio.h>
#include <string.h>
struct node
{
char value;
struct node* link;
};
int main()
{
struct node* top, * p;
char c;
top = NULL;
while ((c = getchar) != '\n');
{
p = (struct node*)malloc(sizeof(struct node));
p->value = c;
p->link = top;
top = p;
}
while (top)
{
p = top;
top = top->link;
putchar(p->value);
}
}
请问top = top->link 是指向空指针吗?