You need endlen
nested loops here. You can avoid writing them explicitely by using a recursive approach:
void all_combinations( char* x, const int len )
{
for (char c = 65; c < 70; ++c){
x[len] = c;
if (len>0){
all_combinations( x, len - 1 );
} else {
printf( "%s\n", x );
}
}
}
int main()
{
const int maxlen = 3;
char x[maxlen+1];
for( int thislen=1; thislen<=maxlen; thislen++ ){
x[thislen] = 0;
all_combinations( x, thislen-1 );
}
}