#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXBUFF 1024
#define N 4
void combine(char *dst, char *src, int pos, int start)
{
int i = 0;
for (i = start; i < N; i++){
dst[pos]=src[i];
dst[pos+1]='/0';
printf("%s/n", dst);
if ( i < N-1 )
combine(dst, src, pos+1, i+1);
}
}
void main(void)
{
char dst[MAXBUFF];
char src[MAXBUFF];
memset(dst, 0, sizeof(dst));
memset(src, 0, sizeof(src));
strcpy(src, "abcd");
combine(dst, src, 0, 0);
}