News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by rayval on Saturday June 05, 2010 @01:22AM (#1406421)
Coming late to the party, here is my version. Even though it uses some weird constructs, it compiles and runs with TurboC V2.01 from 1988:

    char *d,*s;
    for(d = s =  z_terminated; 
        *s; 
        s += (char_to_remove== *s)?1:((*d++ = *s++),0)) 
           {;}
     *d = *s;
Note this is the "fun version". For production code, I would use more conventional constructs, rather than the comma-delimited embedded expression with side effects.

There are no comments on this comment yet.