title: How to assign null to pointer of struct?
body: <p>I am not sure i'f i was specific and clear enough.
  But ill clear the doubt.
  I am trying to assign a NULL value to a pointer.</p>
  
  <p>given the code :</p>
  
  <pre><code>typedef struct Date
  {
  int year;
  int month;
  }Date;
  
  typedef struct Record
  {
      char name[20];
      char cdate[20];
      float quanitity;
      int barcode;
      Date date;
  }Record;
  </code></pre>
  
  <p>and then in main : </p>
  
  <pre><code>Record *records = malloc(10 * sizeof(Record));
  records[0] = NULL;
  </code></pre>
  
  <p>This just doesn't work, when I define a similliar array of premitive type, for example int
  I can assign values, or NULL
  For example for</p>
  
  <pre><code>int *avi = malloc(sizeof(int)*10);
  avi[0] = 3;
  avi [0] = NULL;
  </code></pre>
  
  <p>It works fine, i've printed the values and seen the changes.
  However when I do the same for an array of pointers to struct, as defined above
  I just can not assign a NULL value..</p>
  
  <p>clueless. 
  I am using eclipse IDE.
  thanks in advance.</p>