请各位大侠,,帮个忙,什么意思啊
连接错误。。。原因。。#include <stdio.h>
#define NUM 200
int inBuf[NUM], outBuf[NUM], count=0;
void readData();
void writeData();
void findValue()
{int l,j,k=0,thou,hund,ten,data,temp;
for(l=0;l<NUM;l++)
{thou=inBuf[l]/1000; hund=inBuf[l]%1000/100; ten=inBuf[l]%1000%100/10; data=inBuf[l]%10;
if( (inBuf[l]%2==0) && (thou+ten==hund+data)) {count++;outBuf[k++]=inBuf[l];}
}
for(l=0;l<count-1;l++)
for(j=l+1;j<count;j++)
if(outBuf[l]>outBuf[j]) {temp=outBuf[l];outBuf[l]=outBuf[j];outBuf[j]=temp;}
}
void main()
{
int i;
readData();
findValue();
writeData();
printf("count=%d\n", count);
for(i=0; i<count; i++)
printf("outBuf[%d]=%d\n", i, outBuf[i]);
}
void readData()
{
FILE *fp;
int i;
fp = fopen("IN.DAT", "r");
for(i=0; i<NUM; i++)
fscanf(fp, "%d,", &inBuf[i]);
fclose(fp);
}
void writeData()
{
FILE *fp;
int i;
fp = fopen("OUT.DAT", "w");
fprintf(fp, "count=%d\n",count);
for(i=0; i<count; i++)
fprintf(fp, "%d,\n", outBuf[i]);
fclose(fp);
}
函数是没有错的,,,小弟真的想不到啊。。。。。。
error LNK2005:main already defined in cpp1.obj
debug/cpp1.exe:fatal error LNK1169:one or more multiply defined symbols found.......