#include<stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "string.h"
#include <stdlib.h>
typedef struct list{
char info_name[128];
int num;
struct list *pre;
struct list *node;
struct list *next;
}info_list;
/* 1.初始化线性表,即置单链表的表头指针为空 */
static info_list* init_list(void){
info_list* node;
char buff[128] = "hello";
node = (info_list*)malloc(sizeof(info_list));
//node->info_name[0] = buff[0];
node->info_name = "hello"; //------->[ 问题点 ]
node->pre = NULL;
node->node = NULL;
node->next = NULL;
return node;
}
int main()
{
char buff[128] = "hello";
info_list* my_list;
my_list = (info_list*)init_list();
printf("--------------------------------\n");
printf("buff[0] : %c \n",m
关于对node中数组赋值的问题(已解决)
最新推荐文章于 2021-08-29 21:43:57 发布