#define LINES 65536 // Максимальное количество строк для сортировки
#define MAXCHARSINLINE 1024 // Максимальное количество символов в строке
#define NUMBER_OF_STRINGS (sizeof(strings)/sizeof(strings[0]))
char *strings[LINES];
static int cmp(const void *left, const void *right)
{
char *l = (char *) left;
char *r = (char *) right;
l += posofword;
r += posofword;
return strncmp(r, l, wordlen);
}
main
...
qsort(strings, NUMBER_OF_STRINGS, sizeof(char *), cmp);
Сортировка проходит не правильно - где может быть ошибка?


Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от kosmonavt


Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от anonymous

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от kosmonavt

Ответ на:
комментарий
от UVV

Ответ на:
комментарий
от kosmonavt

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум [c++0x]Почему в qsort можно передать незамкнутую лямбду, но нельзя замкнутую? (2010)
- Форум free после return (2005)
- Форум Программа из K&R вопросы по warnings, полученные от gcc (2015)
- Форум Массивы указателей K&R (2015)
- Форум проблема массивом указателей (2008)
- Форум Использование глобальных const char* (2015)
- Форум Сортировка структуры (2013)
- Форум использование new(void*, size_t) (2008)
- Форум Шаблоны, почему не работает? (2017)
- Форум YACC (2012)