string permutation in c