Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  display contents of file
Language: C/C++
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
     FILE *fp1;
        if(argc==2)
         {
            strcpy(strFlNm,argv[1]);
            fp1=fopen(strFlNm,"r");
            if(fp1)
           {
                  while(!feof(fp1))
                        {
                            fgets(strTxt,fp1);
                            puts(strTxt);
                        }
                  fclose(fp1);
              }
         }
     return 0;
}
          
Comments: