/* John Pfeiffer 2010-05-17 dos version of linux "cat" */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char c;
FILE* fp;
if( 2 != argc )
{ printf("wrong number of arguments, should be cat.exe filename\n");
exit(1);
}
fp = fopen(argv[1],"r");
if( fp == NULL )
{ printf("error opening file\n");
}
else
{
c = getc(fp);
while( !feof(fp) )
{
putc( c , stdout);
c = getc(fp);
}
fclose(fp);
}
return( 0 );
}/* end main */