Here is what I have done so far, Not sure on how to use the bit of the code given , I think im nearly there but not sure, here is what I have done now with that other bit of code, yet it fails with following problems
Code:
#include <string.h>
#include <stdio.h>
int main( void )
{
char text[ 256 ] = { '\0' };
int found = 0;
int counter;
printf( "Please enter a string: " );
scanf( "%255s", text );
for ( counter = 0; counter < strlen( text ); counter++ )
{
if ( text[ counter ] == 'm' )
{
found = 1;
break;
}
}
void str_repall(char *text,char old,char new)
{
char *c;
c = text;
for (c=text;c;c++) { //test that current!='\0'
if (*c == old)
*c = new;
}
}
error: invalid operands for equal operator ==
error: syntax error before or at line 26
: if (*c == old)
: if (*c == old)<== ???
error: missing '}'
error: in program ending, may be missing }
ch in free(): warning: chunk is already free
error: cannot recover from previous errors
at line 30
Cheers