动态内存没分配;
L *LL;
改成
L *LL = (L *)malloc(sizeof(L));
全部代码:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<malloc.h>
int main()
{
typedef struct
{
int no;
char nn;
}L;
L *LL = (L *)malloc(sizeof(L));
LL->no=1;
printf("%d",LL->no);
free(LL);
LL = NULL;
getch();
return 0;
}