C语言编程遇到难题了··求帮忙

Worm340065034 2012-05-08 09:18:34
程序如下:
头文件

23 union {
24 char ch;
25 unsigned uch;
26 signed sch;
27 int in;
28 unsigned uin;
29 signed sin;
30 short int shin;
31 unsigned short ush;
32 signed short ssh;
33 long int lin;
34 unsigned long ulon;
35 signed long slon;
36 long long lonlon;
37 unsigned long long ulonlon;
38 float fl;
39 double dou;
40 }data;
41
42 typedef struct {
43 union data;
44 struct fun_data* next;//用于指向下一个参数
45 }fun_data;
54 struct afun_data{
55 char* fun_name;
56 fun_data* start_data;
57 struct afun_data* next;//用于指向下一个函数
58 struct afun_data* last;
59 } ;
60
61 pid_shm back_shm;
62 struct afun_data* fun_now;
63 fun_now=(struct afun_data*)malloc(sizeof(struct afun_data));
64 fun_data *data_now,pointb;
65 data_now=&pointb;

程序代码部分
40 void send_fun(char* a)
41 {
42 struct afun_data* fun_new;
43 fun_new=(struct afun_data*)malloc(sizeof(struct afun_data));
44 fun_new->fun_name=(char*)malloc(sizeof(char)+1);
45 fun_new->fun_name=a;
46 fun_now->next=(struct afun_data*)malloc(sizeof(struct afun_data));
47 fun_now->next=fun_new;
48 fun_new->last=(struct afun_data*)malloc(sizeof(struct afun_data));
49 fun_new->last=fun_now;
50 data_now=fun_new->start_data;
51 fun_now=fun_new;
52 }
双向链表,fun_now指向当前的,fun_new是新的
46和47会报错···求解析 就解答
没有多少分
...全文
95 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Worm340065034 2012-05-08
  • 打赏
  • 举报
回复
谢谢楼上的 大部分 解决了··谢谢你的指点
如此美丽的你 2012-05-08
  • 打赏
  • 举报
回复
 
40 void send_fun(char* a)
41 {
42 struct afun_data* fun_new;
43 fun_new=(struct afun_data*)malloc(sizeof(struct afun_data));
44 fun_new->fun_name=(char*)malloc(sizeof(char)+1);
45 fun_new->fun_name=a;
47 fun_now->next=fun_new;
49 fun_new->last=fun_now;
50 data_now=fun_new->start_data;
51 fun_now=fun_new;
52 }

随便改了一下!

1.注意一下代码书写规范。
2.设置断点,单步跟踪调试是程序员必备技能之一。

23,120

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧