#include<stdio.h> #include<stdlib.h> void swap(char* x, char* y) { char temp ; temp=*x ; *x=*y ; *y=temp ; } void permute(char *string,int start , int end ) { int j ; if(start==end) printf("%s\n",string) ; else { for(j=start;j<=end;j++) { swap((string+start),(string+j)) ; permute(string,start+1,end) ; swap((string+start),(string+j)) ; } } } int main() { char* check; *check ="ABC" ; permute(check,0,2) ; return 0 ; }
*check ="ABC"
check ="ABC";
char buf[100] = "ABC"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)