Ok, after fiddling around with this code. This is what I have produced.
int curChar, nextAvail;
for (curChar = nextAvail = 0; s[curChar]; curChar++)
if (s[curChar] != ' ' && s[curChar] != '\t' && s[curChar] != '\n'
&& s[curChar] != '\b')
s[nextAvail++] = s[curChar];
if (nextAvail > 0 && s[nextAvail-1] != ' ')
s[nextAvail++] = ' ';
s[nextAvail] = 0;
My run of the test main(); produces this
What the heck is that funky symbol at the end of what it should contain, and what code do I need to fix this up?
Testing your init function.
Failed test eight, customer should contain:
widget;Acme Co.;gear induction device:♂
your string contained:
widget;Acme Co.;gear induction device: