| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 420 人关注过本帖
标题:连接错误提示(PS:BLANK.C 是文件名字) undefined symbol _malloc in mo ...
只看楼主 加入收藏
寂__痴
Rank: 2
等 级:论坛游民
帖 子:34
专家分:23
注 册:2014-4-25
结帖率:75%
收藏
 问题点数:0 回复次数:0 
连接错误提示(PS:BLANK.C 是文件名字) undefined symbol _malloc in module../BLANK.C
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#define len sizeof(struct node)
 struct node{
      char  ch;
      struct node *next;
    };
struct node *inverse(struct node *L)                     /逆置链表
{
 struct node *p=L,*q;
int n=0,i=0;
char t;
while(p!=NULL)
{p=p->next;++n;}
p=L;
for(;i<n-1;i++)
{while(p!=NULL)
{q=p->next;
if((p->ch)<(q->ch)){t=p->ch,p->ch=q->ch,q->ch=t;}
if(q->next!=NULL)p=p->next;
else  p=NULL;
}
p=L;
}
return L;
}
struct node *creat(void)                                   /顺序创建链表
{
struct node *h,*p1,*p2;
int n=0;
p1=p2=(struct node *)malloc(len);
scanf("%c",&p1->ch);
h=NULL;
while(p1->ch!='\0')
{
n+=1;
if(n==1)h=p1;
else p2->next=p1;
p2=p1;
p1=(struct node *)mallloc(len);
scanf("%c",&p1->ch);
}
p2->next=NULL;
return h;
}
void print(struct node *ptt)                   /输出链表  
{
struct node *p;
p=ptt;
if(ptt!=NULL)
do
{
printf("%c",p->ch);
p=p->next;
}while(p!=NULL);
}
int main()                          /main函数
{
struct node *pt,*ptt;
pt=creat();
ptt=inverse(pt);
print(ptt);
printf("\n");
return 0;
}
图片附件: 游客没有浏览图片的权限,请 登录注册

程序要实现的功能是:首先顺序创建一个链表,然后把已经创建好的链表逆序,最后把逆序好的链表输出。
我想问的问题是:怎么解决那个错误。那个错误提示是什么意思?

[ 本帖最后由 寂__痴 于 2014-5-28 18:01 编辑 ]
搜索更多相关主题的帖子: undefined include return 
2014-05-28 15:59
快速回复:连接错误提示(PS:BLANK.C 是文件名字) undefined symbol _malloc i ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014794 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved