S
sabads
Hello everyone:
I have a problem like this :
typedef struct node {
char *data;
struct node *next;
}lnode;
when I allocate space for node p : p = (lnode *)malloc(sizeof(struct
node));
it happened display : Segmentation fault.
I think it will be problem the 'char *data' is not enough
initialization and compiler
cann't know the size precisely. so the space allocated is not satisfy
with the input data ??
so what i should do for this ?
I have a problem like this :
typedef struct node {
char *data;
struct node *next;
}lnode;
when I allocate space for node p : p = (lnode *)malloc(sizeof(struct
node));
it happened display : Segmentation fault.
I think it will be problem the 'char *data' is not enough
initialization and compiler
cann't know the size precisely. so the space allocated is not satisfy
with the input data ??
so what i should do for this ?