[原创]大家改改
											下面是我用dev-c++编的一个程序,看《c语言大全》编的,我想知道argc!=2这个布尔表达式有什么用,还有运行了为什么没有结果,大家看看!
谢谢大家!
#include<stdlib.h>
#include<stdio.h>
int main(int argc,char* argv[])
{
    FILE *fp;
    char ch;
    
    if(argc!=2)
    {    
        printf("You forget to enter the file name!");
        exit(1);
    }
    
    if((fp=fopen(argv[1],"r"))==NULL)
    {
        printf("Can not open the file!");
        exit(1);   
    }
    
    ch=getc(fp);
    while(ch!=EOF)
    {
        putchar(ch);
        ch=getc(fp);             
    }
    
    fclose(fp);
    
    system("pause");
    return 0;
}

 
											





 
	    