C语言高手,帮我的这个程序加个getch();让屏幕停住吧!谢谢!

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:29:11
源程序如下:
#include<stdio.h>
#include<malloc.h>
#define READ(ch) ch=getc(fp)
char ch;
int right=0;

FILE *fp;
struct struCH{
char ch;
struct struCH *next;
}struCH,*temp,*head,*shift;

void main(int argc,char *argv[]){
void E ();

void E1();

void T ();

void T1();

void F ();

int errnum=0,k=0,m=0,countchar=0,rownum;
int charerr=0;

if((fp=fopen(argv[1],"r"))==NULL)

{

printf("\n\tCan not open file %s,or not exist it!\n",argv[1]);

exit(0);
}

else printf("\n\tSuccess open file: %s\n",argv[1]);

while(!feof(fp)){

READ(ch);

中间加那么多exit干嘛……程序结构就是这样被破坏的了……

#include<stdio.h>
#include<malloc.h>
#include<conio.h>
#define READ(ch) ch=getc(fp)
char ch;
int right=0;

FILE *fp;
struct struCH{
char ch;
struct struCH *next;
}struCH,*temp,*head,*shift;

void main(int argc,char *argv[]){
void E ();

void E1();

void T ();

void T1();

void F ();

int errnum=0,k=0,m=0,countchar=0,rownum;
int charerr=0;

if((fp=fopen(argv[1],"r"))==NULL)

{

printf("\n\tCan not open file %s,or not exist it!\n",argv[1]);

getch();exit(0);
}

else printf("\n\tSuccess open file: %s\n",argv[1]);

while(!feof(fp)){

READ(ch);

countchar++;

}

rewind(fp);

if(countchar==0){

printf(&