-1
Hello! I need to make a program that reads a text (string) typed 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 someone help me?
-1
Hello! I need to make a program that reads a text (string) typed 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 someone help me?
1
Assuming you’re 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);
Browser other questions tagged string codeblocks
You are not signed in. Login or sign up in order to post.
Hello Viviana, can you not put the code you have produced so far and we will guide you so that you build the program and learn from it, which I imagine is the goal of this right program of yours?
– Erick Gallani
This should be done with language
C
orC++
?– rray
@Viviana, this question seems to be duplicated, two times ago I answered one with this same objective. a look:http://answall.com/questions/88015/comort-testar-a-condi%C3%A7%C3%A3o-em-um-vetor
– Gabriel Rodrigues
Thank you very much, Gabriel!! That’s just what I needed! I had not seen that this question had already been asked.
– Viviana Schmidt
He’s in the same class ;)
– rray