#Copy a character from one string to the other

4 messages · Page 1 of 1 (latest)

maiden plover
#

Im having a problem.
I want to copy characters from a string, that are different from a character the user types in, into another new string.
The user types in a string(str) and a character(ch). And now if str[a] =! ch, copy that character into a new string.
This is where im stuck now, just cant find a way to make this work.

reef lightBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

mystic gulch
#

Maybe this will help

for(int a=0;a<strlen(str1);a++)
str2[a]=str1[a];
str2[strlen(str1)]=c;
printf("%s",str2);
reef lightBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.