VC中的一个问题、、、、、、、、、、
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
int main()
{
char a;
char name1[50];
FILE *fp;
puts("请输入您要操作的文件名:");
scanf(" %s",name1);
getch();
printf(" %s",name1);
if((fp==fopen(name1,"a"))==NULL)
{printf("文件打开失败\n");a=getch();exit(1);}
else
{printf("文件打开成功\n");}
a=getch();
puts("程序结束");
fclose(fp);
return 0;
}
//总有这两个错误--不懂什么意思
//E:\VC++.6.0\Microsoft Visual Studio\MyProjects\39\39-1wenti.c(15) : warning C4700: local variable 'fp' used without having been initialized
//E:\VC++.6.0\Microsoft Visual Studio\MyProjects\39\39-1wenti.c(15) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'