title: C - Having trouble with the input/output of my structure in by using 2 functions
body: <p>Ok so my objective is to make a structure and give it some values through an input function and output them through an output function, for some reason its 
  output is some scrambled symbols : -1    ░ùI&amp;@0.000000</p>
  
  <p>Any help?</p>
  
  <p>P.S just to note, when I had  my input (scanf statements) and output( printf statements) in the function scan_element, it worked just fine. but when I divided it between two functions, it posted the scrambled symbols above.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  
  struct element_t  {
          int number;
          char name[20];
          char symbol[3];
          char type[20];
          float atomic_weight;
          char shells[6];
      };
  
  void scan_element(struct element_t pl);
  void print_element(struct element_t pl);
  
  int main(int argc, char *argv[]) 
  {
      struct element_t pl;
      scan_element(pl);
      print_element(pl);
      return 0;
  }
  
  void scan_element(struct element_t pl)
  {
      printf("number:");
      scanf("%d",&amp;pl.number);
  
      printf("name:");
      scanf("%s",&amp;pl.name);
  
      printf("symbol:");
      scanf("%s",&amp;pl.symbol);
  
      printf("class:");
      scanf("%s",&amp;pl.type);
  
      printf("atomic weight:");
      scanf("%f",&amp;pl.atomic_weight);
  
      printf("shells use underscore for spaces :");
      scanf("%s",&amp;pl.shells);
  }
  
  void print_element(struct element_t pl)
  {
      printf("%d",pl.number);
      printf("%s",pl.name);
      printf("%s",pl.symbol);
      printf("%s",pl.type);
      printf("%f",pl.atomic_weight);
      printf("%s",pl.shells);
  }
  </code></pre>