Hello! I need to make a program that reads a string entered by the user with a maximum of 500 characters, and print this text by replacing the first letter of each word with an asterisk '*'.
Can anyone help me?
Hello! I need to make a program that reads a string entered by the user with a maximum of 500 characters, and print this text by replacing the first letter of each word with an asterisk '*'.
Can anyone help me?
Assuming you are using C
void subs(char *str)
{
str[0] = '*';
int size = strlen(str);
for(int i = 1; i < size; i++)
if(str[i - 1] == ' ')
str[i] = '*'
}
// Dentro da main vc le normal e chama a funcao
subs(string);