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

VC书籍

开发平台:

C++ Builder

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #define VIDEO 0xB800   // CGA base
  4. void main(void)
  5.  {
  6.    FILE *fp;   
  7.    int offset;
  8.    
  9.    if ((fp = fopen("SAVE_SCR.DAT", "wb")) == NULL)
  10.      printf("Error opening filen");
  11.    else
  12.     {
  13.       for (offset = 0; offset < 8000; offset++)
  14.         fprintf(fp, "%c", peekb(VIDEO, offset));
  15.       fclose(fp);
  16.     }
  17.  }