title: Initialize struct in class constructor
body: <p>How can we initailize a struct pointer in constructor of a class.
  Example: </p>
  
  <pre><code>struct my_struct{
      int i; 
      char* name;
  }; 
  class my_class{ 
      my_struct* s1;
      my_class() {
          // here i want to make s1-&gt;i = 10; and s1-&gt;name = "anyname" ;  
          // should i assign it like s1-&gt;i= 10; and call new for s1-&gt;name and strcpy(s1-&gt;name "anyname");  
          // it compiles in g++ without any warning/error but gives seg fault at run time  
      }
  };
  </code></pre>