New_type.c
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 0k
Development Platform:

C++ Builder

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void main(int argc, char *argv[])
  4.  {
  5.    char line[255];  // Line read from the file
  6.    FILE *fp;
  7.    if (fp = fopen(argv[1], "r"))
  8.      {
  9.        while (fgets(line, sizeof(line), fp))
  10.          fputs(line, stdout);
  11.        fclose(fp);
  12.        exit(0);  // Successful
  13.      }
  14.    else 
  15.      {
  16.        printf("Cannot open %sn", argv[1]);
  17.        exit (1);
  18.      }
  19.  }