I'm using SAMS Book "Teach Yourself "C" in 21 Days" sixth edition.
useing the Editor/Compiler that came with the Book. DEV C++
The saubject program that I'm trying to compile is Print_it.c
it prints files w/line numbers and when the compiler gets to the first
line with "STDPRN" it stops compiling and says Undeclared reference
I'm confused and don't have a clue how to fix this problem; inclosing
a listing of this Program.
/* print_it.c-This program prints a listing with line numbers! */
#include <stdlib.h>
#include <iostream.h>
#include <stdio.h>
void do_heading(char *filename);
int line = 0,page = 0;
int main( int argv, char *argc[] )
{
char buffer[256];
FILE *fp;
if( argv <2 )
{
fprintf(stderr, "\n inProper Usage is: " );
fprintf(stderr, "\n\nprint_it.c\n\n" );
return(1);
}
if ((fp = fopen( argc[1], "r" )) ==NULL )
{
fprintf( stderr, "Error opening file, %s!",argc[1]);
return(1);
}
page = 0;
line = 1;
do_heading( argc[1]);
while( fgets(buffer,256, fp ) != NULL )
{
if( line %55 == 0 )
do_heading(argc[1] );
fprintf( stdio, "%4d:\t%s", line++,buffer );
}
fprintf(stdprt, "\f" );
fclose(fp);
return(0);
}
void do_heading(char *filename )
{
page++;
if ( page > 1)
fprintf( stdprt, "\f" );
fprintf( stdprt, "page: %d, %s\n\n", page, print_it.c );
}
any asstance would be appreciated.
Dick