This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

linked lists in lpc2136 error initializing pointers in null

Hello to everyone

I am creating a linked list that contains id and name information. I am having a runtime error when I initialize list_node * newlist = {NULL} already contains it has information just like list_node newnode and it doesn't allow me to initialize in null.

. What should I do to initialize everything in NULL without new data.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
typedef struct nodo list_node;
struct nodo
{
int count;
char name[20];
struct nodo *p1;
};
struct nodo *crearlista_ssid(char *[5]);
struct nodo * crearlista_ssid(char *array[5])
{
char *lista2;
list_node *newlist={NULL},*aux={NULL};
for(int i=0;i<=4;i++)
{
list_node *newnode= (list_node*) malloc(sizeof(list_node));
if(newnode)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0