title: Total size of a linked list in C
body: <p>Alright... my Introduction to Data Structures from CS is so rusty I need to ask this here.</p>
  
  <p>I have a linked list whose structure is:</p>
  
  <pre><code>struct Data_Struct {
      char *Name;
      char *Task;
      char *Pos;
      struct Data_Struct *Next;
  };
  typedef struct Data_Struct MyData;
  </code></pre>
  
  <p>Now, at some point in my application I filled the list with data.</p>
  
  <p>The question is, how do I get the total size of the data stored in there? How many chars are there? Something like</p>
  
  <pre><code>sizeof(MyData);
  </code></pre>
  
  <p>That will return the size of the info stored in the list.</p>
  
  <p>code is appreciated.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>:
  Unfortunately this is NOT homework. I finished school more than 20 years ago and frankly i never ever had to use linked lists on anything. I just don't remember.
  What I am doing is iterate the list and get the strlen() of each element and keep it on a global size but I wanted to know if there was a better way.</p>
  
  <p>and NO, I don't need the size of the linked likes (the count of nodes), i just want to know how many characters are stored in there.</p>
  
  <p>thanks</p>