I would write a function , that elaborates a struct and return the length of an array of character ,that is define in the same struct, in a recursive way.
The struct is:

```
typedef struct BinSeq {
char* data;              
int dimension;         
}BinSeq

```

data, the array of character,can have only two type of character: '0' and '1',while dimension is the length of array, but not of sequence of '0' and '1'.
So I try to write this function:

```
int length(BinSeq* bin_seq) {
   int i;
   if(bin_seq->data[i] == '0' || bin_seq->data[i] == '1')
   {
         i++;
         return 1 + length(bin_seq->data[i]);
    }else
             return 0;
}

```

but I have may doubts about this. First caused by the compiler that says:

```
warning: passing argument 1 of ‘length’ makes pointer from integer without a cast [enabled by default]
              return 1 + length(bin_seq->data[i]);
              ^
recursion.c:13:6: note: expected ‘struct BinSeq *’ but argument is of type ‘char’
  int length(BinSeq* bin_seq) {

```

How can I work on the data , If I had to pass to my function the Binseq\* bin\_seq? I know that my code is in error for this , but if I want calculate the leght I had to increment the variable i, but the it won't , I think, increase. How can I work on this?