主题:急求?
在TC里能运行,可在VC中运行却出现这样的情况,望哪位高手指点
#include <stdio.h>
main()
{
int n;
int i;
int j;
printf("请输入想得到的正方形的边长: ");
scanf("%d",&n);
for (i=1;i<=n;i++)
printf("*");
printf("\n");
for(j=2;j<n;j++)
{
for(i=1;i<=n;i++)
{
if (i==1||i==n)
printf("*");
else
printf(" ");
}
printf("\n");
}
for(i=1;i<=n;i++)
printf("*");
printf("\n");
return 0;
}
--------------------Configuration: luntan1 - Win32 Debug--------------------
Compiling...
c3.cpp
Linking...
c2.obj : error LNK2005: _main already defined in c1.obj
c3.obj : error LNK2005: _main already defined in c1.obj
Debug/luntan1.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.
luntan1.exe - 1 error(s), 0 warning(s)
#include <stdio.h>
main()
{
int n;
int i;
int j;
printf("请输入想得到的正方形的边长: ");
scanf("%d",&n);
for (i=1;i<=n;i++)
printf("*");
printf("\n");
for(j=2;j<n;j++)
{
for(i=1;i<=n;i++)
{
if (i==1||i==n)
printf("*");
else
printf(" ");
}
printf("\n");
}
for(i=1;i<=n;i++)
printf("*");
printf("\n");
return 0;
}
--------------------Configuration: luntan1 - Win32 Debug--------------------
Compiling...
c3.cpp
Linking...
c2.obj : error LNK2005: _main already defined in c1.obj
c3.obj : error LNK2005: _main already defined in c1.obj
Debug/luntan1.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.
luntan1.exe - 1 error(s), 0 warning(s)