Tuesday, August 17, 2010

Alphabetical sort using strcmp question

Alphabetical sort using strcmp question

參考來源:

"for (i = 0; i < MAXLINE - 1; ++i)     {         for (j = i; j < MAXLINE; ++j)         {             if (strcmp(m[i], m[j]) > 0)             {                 const char *swap = m[i];                 m[i] = m[j];                 m[j] = swap;             }         }     }"
- Alphabetical sort using strcmp question - C / C++ answers (在「Google 網頁註解」中檢視)

No comments: