Message-ID: From: "Alstrup, Kurt" To: "'djgpp AT delorie DOT com'" Subject: RE: ANSI Date: Tue, 27 Jul 1999 11:24:33 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com If the your program is reproduced correct in your mail, then you miss a quote in a printf and you end up having the content of the next string (starting with a \) interpreted as code. To my knowledge djgpp is as close to ANSI as you can come using a GNU compiler. Regards, Kurt Alstrup -----Original Message----- From: margi [ mailto:margi AT club-internet DOT fr ] Sent: Tuesday, July 27, 1999 10:15 AM To: djgpp AT delorie DOT com Subject: ANSI 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 = fopen( argc[1], "r" )) == NULL ) { fprintf( stderr, "Erreur d'ouverture du fichier, %s!", argc[1]); exit(1); } page = 0; line = 1; do_heading( argc[1]); while( fgets( buffer, 256, fp ) != NULL ) { if( line % 55 == 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)