c语言中有关文件的程序能否在vc环境下运行?怎么运行? 头文件有什么不同吗?
我写了个这样的程序:从键盘输入一些字符,逐个把它们送到磁盘上去,直到输入一个“#”为止!
在运行时候有两个错误:error C2065: 'fput' : undeclared identifier; error C2065: 'flcose' : undeclared identifier
在msdn中查找也得不到结果!
谢谢各位高位了弄的好恼火了
#include<iostream>
using namespace std;
main()
{FILE*fp;
char ch,filename[10];
scanf("%s",filename);
if((fp=fopen(filename,"w"))==NULL)
{printf("cannot open file\n");
exit(0);}
ch=getchar();
ch=getchar();
while(ch!='#')
{ fput(ch,fp);
putchar(ch);
ch=getchar();
}
flcose(fp);
}