title: Looping through an array of structs
body: <p>I have this structure and I thought I could set the condition if the structure is pointing to a NULL value. </p>
  
  <p>Here is my simple structure for this example:</p>
  
  <pre><code>typedef struct
  {
      char *name;
      char *data;
  } details_t;
  
  
  details_t emp_details [] =
  {
      { "peter", "lawyer" }, 
      { "john", NULL }, /* No data for john */
      { NULL, NULL },   /* Indicates last element in the array */
  };
  </code></pre>
  
  <p>I think I should be increment the emp_details array and dereferencing the pointer to see if it contains a NULL in the first array element. But not sure if I am going in the right direction. </p>
  
  <pre><code>for(i=i; *emp_details; i++)
  {
      printf("Name: [ %s ] [ %s ]\n", emp_details[i].name, emp_details[i].data);
  }
  </code></pre>