Well, the thing which is missing from the above code is somewhere to put the result. Hence the difficulty on line 19.
How about adding at line 5
Then instead of using
at line 14, add the current character to
That should do the trick.
(there are at least three ways to add a character to the end of a string, using
. I'd use the first option).
There are a few things that are either wrong or bad practice with the above code,
are badly-named, they are not strings at all, and should not be named as such.
The variable p in the for loop is of type
, when it would be much better to use an
. The use of char p means the code will fail if the input string is longer than 127 characters.