title: Typedef not working as parameter or return in Arduino sketch function
body: <p>Im trying to do a linked list in the Arduino ide.</p>
  
  <p>Code is as follows:</p>
  
  <pre><code>typedef struct ll{  
      struct ll * prev;
      unsigned int currTime;
      unsigned int stopTime;
      struct ll * next;
  } TIMING;
  
   TIMING * head;
   TIMING * current;
  
  void setup();
  void add_new_first(int stopTimer, TIMING * head);
  
  void main() {
   init();
   setup();
   // Code that uses the def
   head-&gt;prev = NULL;  
   head-&gt;next = NULL;
   head-&gt;currTime = 0;
   head-&gt;stopTime = 200;
  
  }
  </code></pre>
  
  <p>There is also the actual code of the functions at the end.</p>
  
  <p>This example gives me the error : </p>
  
  <blockquote>
    <p>service_timer_cpp.cpp:5:34: error: ‘TIMING’ has not been declared. </p>
  </blockquote>
  
  <p>When not using the defined type as a parameter or return from a function it works without errors.</p>
  
  <p>This is how I thought it could be done in c and has worked for me earlier. I don't understand why it is not working in the Arduino environment.</p>