4 ms·That's fairly redundant. char *p; while (p = strchr(tmpfn, ' ')) *p = '_';by rntz 17y agoThat's fairly redundant. char *p; while (p = strchr(tmpfn, ' ')) *p = '_';tptacek 17y agoOW MY BRAIN. char *cp = NULL; for(cp = tmpfn; cp && *cp; cp++) if(isspace(*cp)) *cp = '_';jagjit 17y agochar cp = tmpfn; for(; cp; cp++) if(cp == ' ') cp = '_'; my brain tootptacek 17y agoI love that the O(n^2 / 2) algorithm for this problem is modded 4x the O(n) one.jongraehl 17y agoIf you meant to be O(n), you should have used p=strchr(p,' ') for the next-iteration part of your for loop.tptacek 17y agoI didn't write that code, Google did. I wonder if the person who wrote it can figure out how many golf balls fit in a school bus?