delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/10/29/09:22:16

Via: uk.ac.manchester-computing-centre.nessie; Thu, 29 Oct 1992 14:05:32 +0000
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: A DOT APPLEYARD AT fs1 DOT metallurgy DOT umist DOT ac DOT uk
Date: 29 Oct 92 14:04:02 GMT
Subject: Re: Saving Gnu C/C++ compiler errors on a file
Sender: A DOT APPLEYARD AT fs1 DOT mechanical-engineering DOT umist DOT ac DOT uk

  > How can I get the Gnu C/C++ compiler to send the compiler error remarks to a
file as well as to the screen?...

  I wrote this short Gnu C program, which copies the current text screen onto
a file called T$SCREEN in the current directory. It has proved useful:-

/* copies text screen onto file T$SCREEN . compile with -lpc */
#include<stdio.h>
#include<pc.h>
main(){int cols=ScreenCols(),rows=ScreenRows(); char s[cols+1];
unsigned short*screen=(unsigned short*)ScreenPrimary; int i,j,k;
FILE*F=fopen("t$screen","w");
for(i=0;i<rows;i++) {for(j=0;j<cols;j++) s[j]=255&screen[i*cols+j];
    for(j=cols-1;j>=0;j--) if(s[j]!=' ') break;
    s[k=j+1]=0; for(j=0;j<k;j++) putc(s[j],F); putc('\n',F);}
fclose(F);}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019