News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by Xurinos on Thursday June 03, 2010 @12:05PM (#1401684)
I use do...while instead of the for loop, making the usual nasty C-programmer use of ++ in the right spots, but other than that, my solution is the same.

Edit: Correction... I also copy the '\0' character before exiting instead of making that a separate step. It has to do with the order of things. Here is the code:

   char* read_ptr = s;
   do {
      if (*read_ptr != c) {
         *s++ = *read_ptr;
      }
   } while (*read_ptr++ != '\0');

There are no comments on this comment yet.