标题:编一个输出链表的函数print
只看楼主
p18844058918
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2016-4-25
结帖率:100%
已结贴  问题点数:20 回复次数:3 
编一个输出链表的函数print
#include<stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct Student)
struct Student
{
    long num;
    float score;
    struct Student *next;
};

int n;
void print(struct Student *head)
{
    struct Student *p;
    printf("\nNOW,These %d records are:\n",n);
    p=head;
    if(head!=NULL)
        do
        {
            printf("%ld %5.1f\n",p->num,p->score);
            p=p->next;
        }while(p!=NULL);
}
为什么编译时有错呢?希望有高手指点,谢谢!
错误提示如下:
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/file-1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
        
搜索更多相关主题的帖子: include records 
2016-05-02 22:24
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:432
帖 子:10064
专家分:41463
注 册:2014-5-20
得分:10 
main()
2016-05-02 23:03
linlulu001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:20
帖 子:944
专家分:4047
注 册:2016-4-13
得分:10 
没有主函数,写一个主函数出来吧。如果第二个函数是主函数的话那就肯定有问题了。
2016-05-03 00:00
p18844058918
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2016-4-25
得分:0 
谢谢你们!
2016-05-09 10:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-464328-1-1.html




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

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