title: Assigning values and passing struct as parameter
body: <ul>
  <li>To asign a <em>char value</em> into the struct 'field', I <em>have to</em> use <em>strcpy</em> ?  </li>
  </ul>
  
  <p>I tried this:  </p>
  
  <pre><code>struct student{
  
     char name[50];
     int  age;
  };  
  
  
  int main(){
  
  struct student std;
  
  std.name = "john";  //Doesnt work
  strcpy(std.name, "john");  //It DOES work
  std.age = 20;
  
  return 0;}  
  </code></pre>
  
  <p>Why when comes to <em>char</em> I can not simply use the ' = ' to assign a value ?  </p>
  
  <ul>
  <li><p>How may I pass a struct initialized in <em>main(){}</em> as a parameter to a function and change it's values inside the function without the need of a return. 
  Do I just use the '*'  like:  </p>
  
  <pre><code>   void MyFunction(struct student *std){            
     std-&gt;Name = "John";
     std-&gt;Age = 20; 
     }
  
     int main(){
     struct student me;    
     Myfunction(me);
     }
  </code></pre></li>
  </ul>
  
  <p>Is that the correct way to do so ?</p>