here is the link : https://ide.codingblocks.com/s/208208
Why my code is not working
There is some problem with the sorting function. You can use string instead of character array to store name. Also use inbuilt sort with comparator function.
Hope it Helps.