permute in c