title: C | Passing a function that has multiple parameters as a parameter
body: <p>I have the following code:</p>
  <pre class="lang-c prettyprint-override"><code>typedef struct ll_node linked_list_node;
  struct ll_node {
    int value;
    linked_list_node* next;
  };
  
  typedef struct ll linked_list;
  struct ll {
    size_t size;
    linked_list_node* head;
    linked_list_node* tail;
  };
  
  void for_each(linked_list* list, void (*function)(linked_list_node*, ...)) {
    if (list == NULL || list-&gt;head == NULL) {
      return;
    }
  
    for (linked_list_node* node = list-&gt;head; node != NULL; node = node-&gt;next) {
      function(node, function-&gt;__va_arg_pack());
    }
  }
  </code></pre>
  <p>What I mainly want to achieve is <code>for_each</code> to receive a function that is executed to every single linked list node, but I'm not sure if that can be achieved with functions that receive multiple parameters... Please help!</p>