home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 21
/
CD_ASCQ_21_040595.iso
/
dos
/
prg
/
c
/
freedos3
/
source
/
jh_utils
/
trch.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-07
|
496b
|
31 lines
#include <stdio.h>
/*************************************************************************
* This function translates ch1 in the input stream into ch2.
* author: James Hall
* date: 12/26/94
*/
unsigned long
trch (FILE * p, char ch1, char ch2)
{
unsigned long ul = 0;
char chBuf;
/* Convert characters in the input stream */
while ((chBuf = fgetc (p)) != EOF)
{
if (chBuf == ch1)
{
putchar (ch2);
ul++;
}
else
putchar (chBuf);
}
return (ul);
}