急1运行turboc后出现“Undefined symbol _main in module COS”是怎么回事?

[复制链接]
查看11 | 回复1 | 2009-1-13 23:09:14 | 显示全部楼层 |阅读模式
#include
#include
typedef struct node{
double distance;
char station[20];
struct node *next;
}node_t;
node_t *start;
node_t *NodeAllocate(void)
{
node_t *p = (node_t *)malloc(sizeof(node_t));
if(p == NULL){
fprintf(stderr,"\nERROR: Out of memory\n");
exit(1);
}
return p;
}
void NodeInsert(int ins, node_t *start, node_t *newp)
{
int i;
node_t *p;
for(p = start, i = 1;p != NULL;p = p->next, i++){
if(i == ins){
newp->next = p->next;
p->next = newp;
break;
}
}
printf("%d", i);
}
int main(void)
{
int count = 0, ins;
double d;
node_t *start, *p, *pre_p;
start = p = NodeAllocate();
while(1){
printf("\nPlease type DISTANCEdistance = d;
printf("\nPlease type STATION_NAME>");
scanf("%s", p->station);
p->next = NodeAllocate();
pre_p = p;
p = p->next;
}
}
pre_p->next = NULL;
printf("\n***** Normal display *****\n");
printf("distance station_name\n");
for(p = start;p != NULL;p = p->next){
printf("%8.1f %s\n", p->distance, p->station);
}
printf("\n");
printf("\nPlease type INSERT POSITIONcount){
printf("Ooops! Can't Insert(xox)/");
}else{
printf("\nPlease type DISTANCE distance = d;
printf("\nPlease type STATION_NAME station);
NodeInsert(ins, start, p);
}
}
printf("\n***** Normal display *****\n");
printf("distance station_name\n");
for(p = start;p != NULL;p = p->next)
printf("%8.1f %s\n", p->distance, p->station);
printf("\n");
return 0;
}

回复

使用道具 举报

千问 | 2009-1-13 23:09:14 | 显示全部楼层
你的“enviornment”没配置对!按下F10到菜单中找这项,修改路径就可以了!注意好几项!不明白留言...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行