求解释为什么会有error LNK2001

nichothia 2010-06-06 04:36:28


#include<stdio.h>
#include<stdlib.h>
#include<conio.h>



struct stud
{
char Name[20];
float Score;
struct stud*next;
};
typedef struct stud Student;

int GoonDisplay(int i);

int GoonDispaly(int i)
{
char a;
if(i==0||i%10!=0)
{
return 1;
}
printf("press \'Enter\' to go on: ");
a=getch();
if(a='\n')
{
return 1;
}
else
return 2;
}
void Display(Student*head)
{
static int i=0;
Student*p=(Student*)malloc(sizeof(Student));

if(head!=NULL)
{
p=head;
do
{
printf("%s\n",&(p->Name));
printf("%d",&(p->Score));
p=p->next;
i++;
}
while
(
(i==0||i%10!=0)&&
p->next!=NULL&&
(GoonDisplay(i)==1)
);
}

printf("No data.\n");
}

int main()
{
static Student*head=NULL;
Display(head);
return 0;
}




error LNK2001: unresolved external symbol "int __cdecl GoonDisplay(int)" (?GoonDisplay@@YAHH@Z)
fatal error LNK1120: 1 unresolved externals
...全文
52 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
renbin5566 2010-06-06
  • 打赏
  • 举报
回复
int GoonDisplay(int i)
nichothia 2010-06-06
  • 打赏
  • 举报
回复
好吧。。
huanmie_09 2010-06-06
  • 打赏
  • 举报
回复
函数定义时:
int GoonDispaly(int i)
--->
int GoonDisplay(int i)
z569362161 2010-06-06
  • 打赏
  • 举报
回复
提示你GoonDisplay没 定义了。

肯定是写错了
mstlq 2010-06-06
  • 打赏
  • 举报
回复
请注意拼写……
请学会理解编译器出错提示……
请自行对照下面代码……

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>



struct stud {
char Name[20];
float Score;
struct stud*next;
};
typedef struct stud Student;

int GoonDisplay(int i);

int GoonDisplay/*GoonDispaly*/(int i)
{
char a;
if (i == 0 || i % 10 != 0) {
return 1;
}
printf("press \'Enter\' to go on: ");
a = getch();
if (a == '\n') { /*mark*/
return 1;
} else
return 2;
};
void Display(Student*head)
{
static int i = 0;
Student*p = (Student*)malloc(sizeof(Student));

if (head != NULL) {
p = head;
do {
printf("%s\n", &(p->Name));
printf("%d", &(p->Score));
p = p->next;
i++;
} while
(
(i == 0 || i % 10 != 0) &&
p->next != NULL &&
(GoonDisplay(i) == 1)
);
}

printf("No data.\n");
}

int main()
{
static Student*head = NULL;
Display(head);
return 0;
}

69,368

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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