I need to return a struct with two values in it. A double value (`time`) and an uint8\_t array with a variable size. I have two functions and both of them should return the same type of struct, but with different data members (`data[9], data[64]`).

I've already tried to create a struct with an additional member `size`, but this isn't working at all. `size` should initialize the array with a fixed length, but the compilers says that the variable size is not defined.

```
typedef struct Result {
    double time;
    int size;
    uint8_t data[size];
}

```

The previous wasn't working so I tried to create an empty array and initialize it within my functions, but did not work either.

```
typedef struct Result {
    double time;
    uint8_t data[];
} Result;

Result foo() {
    double time = 17.5;
    uint8_t data[9] = {0};
    Result res = {sizeof(data), time, data};
    return res;
}

Result bar() {
    double time = 9.5;
    uint8_t data[64] = {4};
    Result res = {sizeof(data), time, data};
    return res;
}

int main(void) {
    Result foo = foo();
    printf("%.6f\n", foo->time);
    uint8_t data[9] = foo->data;
    // work with data[9] ...

    Result bar = bar();
    printf("%.6f\n", bar->time);
    uint8_t data[64] = bar->data;
    // work with data[64] ...
}

```

I get this error message:

```none
Error: return type is an incomplete type

```

The members of the struct should be available as shown in the main function. I think the compiler doesn't know how big the `data` array should be, but maybe someone can explain me this context and my question on how to return a struct with a variable sized array in it.

I would appreciate any help, thank you very much.