Hmm. I've found this: j = strlen(name); for(; k<j ; k++) { guess[k]='*'; } but it doesn't seem to work on my code