title: C struct with many [char array ] problem
body: <p>I have a struct with many char array like this (and it works) :</p>
  
  <pre><code>struct maytinh {
      char tenmay[10];
      char mamay[10];
      char test[10];
      float manhinh;
      int gia;
  };
  </code></pre>
  
  <p>But if its like this,</p>
  
  <pre><code>struct maytinh {
      char tenmay[99];
      char mamay[99];
      char test[99];
      float manhinh;
      int gia;
  };
  </code></pre>
  
  <p>it breaks when I compile and scanf data in.
  Moreover when I put another array in the struct, it also breaks:</p>
  
  <pre><code>struct maytinh {
      char tenmay[10];
      char mamay[10];
      char test[10];
      char test2[10];
      float manhinh;
      int gia;
  };
  </code></pre>
  
  <p>Why? (I'm compiling with c-free 4.0)</p>
  
  <p>Here is the scanf code :</p>
  
  <pre><code>void main() {
      int n,i;
      printf("input :");
      scanf("%d",&amp;n);
      struct maytinh a[n];
      for (i=1;i&lt;=n;i++) {    
          printf("May tinh so: %d\n",i);
          printf("Nhap ten may :");
          scanf("%s",a[i].tenmay);
          printf("Nhap ma may :");
          scanf("%s",a[i].mamay);
          printf("Nhap test :");
          scanf("%s",a[i].test);
          printf("Nhap kich thuoc man hinh:");
          scanf("%d",&amp;a[i].gia);
      };
  }
  </code></pre>
  
  <p>this code totally work with the first struct.
  here is my fix for dynamic size struct array with malloc() and typedef (just for someone like me in need):</p>
  
  <pre><code>typedef struct maytinh {
      char tenmay[99];
      char mamay[99];
      char test[99];
      char test3[99];
      float manhinh;
      int gia;
  };
  void main(){
      int n,i;
      printf("input :");
      scanf("%d",&amp;n);
      maytinh *a;
      a=(maytinh*)malloc(n*sizeof(maytinh));
      for (i=0;i&lt;=n;i++) {    
      printf("May tinh so: %d\n",i);
      printf("Nhap ten may :");
      scanf("%s",a[i].tenmay);
      printf("Nhap ma may :");
      scanf("%s",a[i].mamay);
      printf("Nhap test :");
      scanf("%s",a[i].test);
      printf("Nhap kich thuoc man hinh:");
      scanf("%d",&amp;a[i].gia);
      };
  }
  </code></pre>