1. ## Usage of struct ** in linked lists

Code:
```typedef struct gate {
CallBack f;
struct gate ** inputs;
}Gate;```

I have a project in c programming language and I would like to ask how i can use the "inputs" in the struct. I am told that it has to be something like a list but i have only worked with lists like bellow where the *next points to the next item of the list :
Code:
```typedef struct data {
int value;
struct data * next;
}Data;``` 2. If you understand this as being a linked list
struct gate *inputs;

Would you understand this as perhaps being a binary tree?
struct gate *inputs;

Do you now know what this might be?
struct gate ** inputs; 3. i would say that it is a tree of undefined size ???? 4. But how would i use it ??
I mean with the binary tree i could say :

Code:
```typedef struct data {
int val;
struct data *next;
}Data;

Data * lst;

Data * createData(int i){
Data * temp;
temp=malloc....
temp->val=i
temp->next=NULL;
}

lst->val=1
lst->next=createdata(1).......
```

Or something like that.
With the **next how will i assign it, will it be an array like i wrote *next[] ?? 5. I guess somewhere, you need to determine

int numTreeBranches = 42;

Then later, you can do
mygate->inputs = malloc( numTreeBranches * sizeof(*(mygate->inputs)) );

Then you're free to do
mygate->inputs[x] = .... 6. I suppose it would be helpful if you could say what the purpose of using this data structure would be. 7. That is for the case of struct gate *inputs[ ] or for struct gates **inputs ???
This data structure is created to represent logic gates input. I have created a program that calculates output of a circuit but can get only 2 inputs at each gate. Now this struct is needed in which Callback f is the function o f logic gate (and, or, nor...) and the **inputs needs to be the input of the gate. 8. Well it seems like you also need to store in each gate the actual number of input gates. Popular pages Recent additions data, list, pointers, struct, structs 