A01/password.c
/*
 * Replaces char in string
 * @param str string
 * @param old char to be replaced
 * @param new char to be changed to
 */
Replaces char in string
@param str string
@param old char to be replaced
@param new char to be changed to
Replaces char in string @param str string @param old char to be replaced @param new char to be changed to
void replace (char* str, char old, char new) {
    for (int i  = 0; str[i] != 0; i++){
	    if (str[i] == old) {
		    str[i] = new;
	    }
    }
}
void replace ( char * str , char old , char new ) { for ( int i = 0 ; str [ i ] != 0 ; i ++ ) { if ( str [ i ] == old ) { str [ i ] = new ; } } }
Replaces char in string
 @param str string
 @param old char to be replaced
 @param new char to be changed to
Replaces char in string @param str string @param old char to be replaced @param new char to be changed to