sort algorithm stops
i have a li'l problem with some piece of code in a programme... i wrote a sort algorithm (i think it's similar to or the same as bubble sort, no idea...) that suddenly stands still when i use more than ~200 elements in the 3 arrays. i have just changed the variable's names so that you can read this piece without having the whole code- pls don't correct me if i made mistakes with the changed names.
while(i++ < number_of_strings)
for(int counter = 0; counter < number_of_strings; counter++)
if(integer_array[counter] < integer_array[counter + 1])
integer_buffer = integer_array[counter + 1];
strcpy(stringbuffer,string_array[counter + 1]);
integer_array[counter + 1] = integer_array[counter];
integer_buffer[counter] = integer_buffer;
integer_buffer = another_int_array[counter + 1];
another_int_array[counter + 1] = another_int_array[counter];
another_int_array[counter] = integer_buffer;
integer_buffer = 0;
strcpy(string_array[counter + 1],string_array[counter]);
i use printf to show when the loop stands still.. what do i have to change? how to improve the code so that it works with any number of elements > 200?
secondary, if no one knows the answer, pls explain the usage of qsort() to me ;-). but the most important thing i wanna know is why my code stands still.
Please post you array definition and their initializations.
ok, some more infos. first the initializations:
the programme reads an IRC-log-file and then all the nicks; if there's a new nick in the actual line, i increment number_of_strings and copy the name to string_array[number_of_strings];. after i have done this, i increment the element of integer_array, according to the string. as you can imagine, it counts the lines written by the nick... and the third array is for ,,/me text..``-lines.
i hope, you can help now.