Message-ID: <000a01bed853$9eb50060$5085fea9@greedo> From: "margi" To: Subject: ANSI Date: Tue, 27 Jul 1999 19:14:57 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01BED864.50900EA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_0007_01BED864.50900EA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm just learning the c language with a method book, and some of the = exemple programs just can't be compilated, because of some characters = like the "\" inthe following program: /* PRINT_IT.C--permet d'imprimer le listings avec les num,rots de = ligne*/ #include #include void do_heading(char *filename); int line, page; main( int argv, char *argc[] ) { char buffer[256]; FILE *fp; if( argv <2 ) { fprint f(stederr, "\nLa syntaxe correcte est: " ); fprintf(stderr, "\n\nPRINT_IT nomfichier.ext\n" ); exit(1); } if (( fp =3D fopen( argc[1], "r" )) =3D=3D NULL ) { fprintf( stderr, "Erreur d'ouverture du fichier, %s!", argc[1]); exit(1); } page =3D 0; line =3D 1; do_heading( argc[1]); while( fgets( buffer, 256, fp ) !=3D NULL ) { if( line % 55 =3D=3D 0 ) do_heading( argc[1] ); fprintf( stdprn, "%4d:\t%s, line++, buffer ); } fprintf( stdprn, "\f" ); fclose(fp); return 0; } void do_heading( char *filename ) { page++; if ( page > 1) fprintf( stdprn, "\f"); fprintf( stdprn, "Page: %d, %s\n\n", page, filename ); } SO, PLEASE could you say me if DJgpp is comformable to the ANSI = standard? and if yes, how to solve my problem, thank you (scuse my english, i'm french:o) ------=_NextPart_000_0007_01BED864.50900EA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm just learning the c language with a = method=20 book, and some of the exemple programs just can't be compilated, because = of some=20 characters like the "\" inthe following program:
 
/* PRINT_IT.C--permet d'imprimer le = listings avec=20 les num‚rots de ligne*/
#include <stdlib.h>
#include=20 <stdio.h>
 
void do_heading(char = *filename);
 
int line, page;
 
main( int argv, char *argc[] = )
{
char=20 buffer[256];
FILE *fp;
 
if( argv <2 )
{
fprint = f(stederr, "\nLa=20 syntaxe correcte est: " );
fprintf(stderr, "\n\nPRINT_IT = nomfichier.ext\n"=20 );
exit(1);
}
 
if (( fp =3D fopen( argc[1], "r" )) = =3D=3D NULL=20 )
{
fprintf( stderr, "Erreur d'ouverture du fichier, %s!",=20 argc[1]);
exit(1);
}
 
page =3D 0;
line =3D = 1;
do_heading(=20 argc[1]);
 
while( fgets( buffer, 256, fp ) !=3D = NULL=20 )
{
if( line % 55 =3D=3D 0 )
do_heading( argc[1] = );
 
fprintf( stdprn, "%4d:\t%s, line++, = buffer=20 );
}
 
fprintf( stdprn, "\f" = );
fclose(fp);
return=20 0;
}
 
void do_heading( char *filename=20 )
{
page++;
 
if ( page > 1)
fprintf( stdprn,=20 "\f");
 
fprintf( stdprn, "Page: %d, %s\n\n", = page, filename=20 );
}
 
 
SO, PLEASE could you say me = if  DJgpp is=20 comformable to the ANSI standard?
and if yes, how to solve my problem, = thank=20 you
 
(scuse my english, i'm=20 french:o)
------=_NextPart_000_0007_01BED864.50900EA0--