12 lines
203 B
C
12 lines
203 B
C
#include <ctype.h>
|
|
|
|
/* Replace char 'old' by char 'new' in source */
|
|
void chrreplace(char *source, char old, char new)
|
|
{
|
|
while (*source) {
|
|
source++;
|
|
if (source[0] == old) source[0]=new;
|
|
}
|
|
}
|
|
|