Decorate-sort-undecorate idiom: Difference between revisions

→‎{{header|C}}: Should really store the sorted array.
(Added C)
(→‎{{header|C}}: Should really store the sorted array.)
Line 174:
void sortWords(char **words, size_t le, size_t (*f)(const char* s)) {
int i;
char bufferwords2[le][15]; // to store the sorted array
 
/* decorate */
Line 188:
printf("[");
for (i = 0; i < le; ++i) {
sprintf(bufferwords2[i], "\"%s\"", wordkeys[i].word);
printf("%s, ", bufferwords2[i]);
}
printf("\b\b]\n");
9,488

edits