compile通过了,但是build报错怎么回事,求教!
源代码:#include<iostream.h>
#include<stdio.h>
void main()
{
int *ptr1,*ptr2,*p,a,b;
printf("输入2个整数:\n");
scanf("%d,%d",&a,&b);
ptr1=&a;
ptr2=&b;
if (*ptr1>*ptr2)
{
p=ptr1; ptr1=ptr2; ptr2=p;
}
printf("\na=%d, b=%d\n\n", a,b);
printf("min=%d, max=%d\n",*ptr1,*ptr2);
}
就是书上的一个练习:但是老是报错,build就是不能通过
second.obj : error LNK2005: _main already defined in lining.obj
Debug/lining.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
lining.exe - 2 error(s), 0 warning(s)
新人求教,高手