^^ I didn't make any personal remarks or comments. The moderated line only
criticized your hybrid (slang used) C/C++ code, which is obviously *far* from
a *complete standard C* program, as advertised. Nothing personal, again.
No offenses intended or taken, as usual.
Okay, here's a working, but weird C code to print all permutations disregarding
repetitions in input. This program accepts the input string as command line
argument, and will crash in case none is supplied.
Code:
#include <stdio.h>
int main(int a, char **b)
{
char *c;
if (*(c = a ? *b = b[1] : ++*b))
for (main(0, b); *++c; *c ^= **b ^= *c ^= **b)
main ((*c ^= **b ^= *c ^= **b, 0), b);
else puts(b[1]);
--*b;
return 0;
}
Modification to this code, to print all permutations and combinations with
repetitions taken into consideration is left to fellow programmers as an exercise.
As far as the OP is concerned, I'm not sure whether all permutations, or
combinations are required as output.