我正在尝试创建链接列表列表,但我收到警告:
warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
printf("Data in 0 is : %s\n",list[0]->data);
代码在
之下create(0,'A');
printf("Data in 0 is : %s\n",list[0]->data);
create()代码:
void create(int indx, char rsc){
struct Node* tmp = (struct Node*)malloc(sizeof(struct Node));
tmp->data = rsc;
tmp->next = NULL;
list[indx] = tmp;
节点列表初始化如下:
struct Node *list[26];