The Program runs fine with just minor problem. I have written the program but it doesn't seem to sort the names instead it just publish them as entered. Please someone point out the problem that is stopping the sorting. PRONTO PLEASE!!!!
This is just an exact copy of the output:
Original Names
Zoe
Susan
Jack
Sparrow
Clark
Kent
Sorted Names //***NOT SORTED AT ALL, AS APPEARED IN OUTPUT, WHEN COMPILED
Zoe
Susan
Jack
Sparrow
Clark
Kent
Press any key..............
I'm no expert, but I'm pretty sure this is comparing the memory addresses of the two c-strings. At any rate, it doesn't do what you think it does. The expression probably always evaluates as false, which is why the sorting is never done.
NO it works, but not as epected.
Main problem with lines 18-21 where he swapping character at index 16 in 16 character arrays, aka randomly move some memory outside array bounds.
Because array is already sorted. Replace < with > to sort in descending order and it should fire at least once. Actually you should get an infinite loop here