char a[10], b[10], c[10], d[20], e[15], f[5];
a+b
a+b+c
a+b+c+d
...
f+a+c
...
char a[] = "aa";
char b[] = "bb";
char c[] = "cc";
char d[] = "dd";
char e[] = "ee";
char f[] = "ff";
int main()
{
int n, nn, x;
int bits = 6;
char** vars = (char**) malloc(bits * sizeof(char*));
vars[0] = a;
vars[1] = b;
vars[2] = c;
vars[3] = d;
vars[4] = e;
vars[5] = f;
for (n = 0; n != (2 << bits); ++n) {
x = n;
for (nn = 0; nn != bits; ++nn) {
if (x % 2)
printf("%s", vars[nn]);
x >>= 1;
}
printf("\n");
}
return 0;
}