Lexicographical Permutations

Using an inbuilt function of c language to fild all permutations of a given string in ascending order(Using least Amount of time)