New_type.c
上传用户:dq031136
上传日期:2022-08-08
资源大小:802k
文件大小:0k
源码类别:

VC书籍

开发平台:

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.  }