语法没有错但是在编译时有个错误 我看不懂
#include<stdio.h>#include<stdlib.h>
int mian (void)
{
FILE *fp,*dfp;
char c1[100],c2;
if(fp=fopen("150510134-彭霞-1-doc","wt")==NULL)
{
PRINTF("打开文件出错");
system("pause");
exit(1);
}
puts("输入一串字符");
gets(c1);
fputs(c1,fp);
fclose(fp);
if(dfp=fopen("150510134-彭霞-1-doc","rt")==NULL)
{
printf("文件出错");
system("pause");
exit(2);
}
c2=fgetc(dfp);
while(c2!=EOF)
{
putchar(c2);
c2=fgetc(dfp);
}
fclose(dfp);
system("pause");
return 0;
}
.obj : error LNK2001: unresolved external symbol _PRINTF
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/文件.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.
文件.exe - 1 error(s), 0 warning(s)