I want to write a programm, which can print all possible strings of length k that can be formed from a and b.

Example for k = 3: aaa, baa, aba, bba, aab, bab, abb, bbb.

My code isn't working. Can somebody please correct me? Thank you.

```
#include <stdio.h>

void abcombirec(char prefix[], int k) {
    char ab[] = {'a', 'b'};
    if (k == 0) {
        printf("%s\n", prefix);
        return;
    }
    for (int i = 0; i < 2; i++) {
        newprefix = prefix + ab[i];
        abcombirec(newprefix, k - 1);
    }
}

void abcombi(int k) {
    char str[] = "";
    abcombirec(str, k);
}

int main() {
    (abcombi(3));
    return 0;
}

```