'Linked list multi parameters how to do?
I have this part of structure and a list , and I want to fill up with same values.
typedef struct node{
char* place;
int id;
int type;
int price;
struct node * next;
}node;
typedef struct Hotels{
char* name;
char* place;
char* inf_hotel;
days* registration;
rooms* informations;
node* head;
}Hotels;
here is my attempt for to fill up the list
int capacity_rooms=25;
int a[25],b[25],c[25];
char str[25][1024];
struct node *head=malloc(25*sizeof(struct node));
for ( i=0; i<capacity_rooms; i++ ){
head[i].id = a[i];
head[i].price = b[i];
head[i].type = c[i];
head[i].place = str[i];
head[i].next=NULL;
}
is that correct how i create this linked list , i want to store just this 25 values Correct me if iam wrong.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
