#include "stdafx.h"
#include <stdlib.h>/*为了调用system("PAUSE");*/
#include <time.h>/*为了调用time;*/
#include <stdio.h>
#include <string>
#include <windows.h>
int main(int argc , char* argv[])
{
FILE *fp;
char ch, filename[100];
printf("Input the file name:");/*输入文件名字*/
scanf ("%s", filename);
if((fp=fopen(filename,"w"))==NULL) /*创建文件*/
{
printf("Open file fail!\n");
return C_SYS_ERR;
}
printf("Input ch:");
ch =getchar(); /*输入文件内容*/
while(ch!='#')
{
fputc(ch,fp);
ch =getchar();
}
fclose(fp);
system("PAUSE");
return C_SYS_OK;
}
#include <stdlib.h>/*为了调用system("PAUSE");*/
#include <time.h>/*为了调用time;*/
#include <stdio.h>
#include <string>
#include <windows.h>
int main(int argc , char* argv[])
{
FILE *fp;
char ch, filename[100];
printf("Input the file name:");/*输入文件名字*/
scanf ("%s", filename);
if((fp=fopen(filename,"w"))==NULL) /*创建文件*/
{
printf("Open file fail!\n");
return C_SYS_ERR;
}
printf("Input ch:");
ch =getchar(); /*输入文件内容*/
while(ch!='#')
{
fputc(ch,fp);
ch =getchar();
}
fclose(fp);
system("PAUSE");
return C_SYS_OK;
}