fflush(fp);//只要用户按enter键,就会存盘。如果,没有按enter键,而是按了ESC键,那么,下面循环体外面还有fclose()处理。
}//这就相当于linux中行编辑器ed。
if(fclose(fp)==0)/*If file close is success*/
{
printf("saved finish.\n");
goto exit_write_file;
}
else/* Then file close is error*/
{
printf("saved defeated.\n");
goto exit_write_file;
}
exit_write_file:;//分号可以去掉,添加分号相当于是执行了一个空语句。goto的标签语句是不需要分号结尾的。
printf("\"write file\" function exited.\n");
return;
}
//return;}
void cursor_left_move(void);
void cursor_right_move(void);
void cursor_upper_move(void);
void cursor_down_move(void);
void shut_edit_file(void);
int decide_edit_file(void);
void edit_file(void)
{
//edit_file_start:;
FILE * fp;
char pn[PN_VALURE];
//char ch;
int ch;
printf("Input want editing path and name from file:\n");
scanf("%s", &pn);//可以不带&,但最好带&
ch = getc(stdin);
if(ch == '\n')
{
ch = '\0';
putc(ch, stderr);
}
}//这就相当于linux中行编辑器ed。
if(fclose(fp)==0)/*If file close is success*/
{
printf("saved finish.\n");
goto exit_write_file;
}
else/* Then file close is error*/
{
printf("saved defeated.\n");
goto exit_write_file;
}
exit_write_file:;//分号可以去掉,添加分号相当于是执行了一个空语句。goto的标签语句是不需要分号结尾的。
printf("\"write file\" function exited.\n");
return;
}
//return;}
void cursor_left_move(void);
void cursor_right_move(void);
void cursor_upper_move(void);
void cursor_down_move(void);
void shut_edit_file(void);
int decide_edit_file(void);
void edit_file(void)
{
//edit_file_start:;
FILE * fp;
char pn[PN_VALURE];
//char ch;
int ch;
printf("Input want editing path and name from file:\n");
scanf("%s", &pn);//可以不带&,但最好带&
ch = getc(stdin);
if(ch == '\n')
{
ch = '\0';
putc(ch, stderr);
}
