title: why can i not add string in a structure
body: <p>I was trying to define structure having an int and string type members.  </p>
  
  <pre><code>typedef struct emp{
      int sno;
      string name;
  }
  </code></pre>
  
  <p>When I allocated space using <code>malloc</code> and modified the name variable, it gives <code>Segmentation Fault</code>.  <br/>  I searched on stackoverflow and found solution to use <code>char*</code> instead of <code>string</code> type. Is it because <code>char*</code> has a fixed size (pointer size)?
  Also how does <code>sizeof</code> treats a string variable since its length is not known before allocation?</p>