|
|
|
|
|
|
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space. |
'\0'
but 32
. I would probably do the opposite: 0
and ' '
.
|
|
|
|
|
|
|
|
|
|
s? hello "hello " |
to
just before line 15 fixes the problem, i.e.
|
|
s? hello "hello" |
s? hello orig = {' ',' ','h','e','l','l','o',' ',' ','\0'} step 1 = {'h','e','l','l','o',' ','\0',' ',' ','\0'} step 2 = {'h','e','l','l','o',' ','\0',' ',' ','\0'} "hello " |
|
|
I couldn't use pointers. |
|
|
|
|
#include <string.h>
#include <cstring>