程序没有错,程序链接出错,请大虾们帮忙看一下
/* 班上有四个同学的成绩,用search函数求i个学生的成绩*/#include<stdio.h>
void mian()
{
void search(int (*p)[4],int n);
int score[][4]={{78,25,56,79},{89,45,78,36},{78,69,69,97},{87,98,96,92}};
int i;
scanf("%d",&i);
search( score,i); /*求编号为i的成绩*/
}
void search(int (* p)[4],int n)
{
printf("the score of NO.%d are:\n",n);
int i;
for(i=0;i<4;i++)
{
printf("%4d",*(p +n)+i);
}
printf("\n");
}
错误显示:
--------------------Configuration: cmsgc - Win32 Debug--------------------
Compiling...
Cpp2.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/cmsgc.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
cmsgc.exe - 1 error(s), 0 warning(s)
我看了:VC6 里的 工程/设置/链接/工程 选项已经是/subsystem:console