title: Console C Program stopped working dev c++
body: <p>I was practicing array of structure. I made the following program and there were no compiling errors.But when i try to run it(I guess these errors are called runtime errors?),it stops working just after accepting the roll number. I wonder what wrong i did.
  I use Dev c++ and gcc compiler.
  Here's the code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  
  
  
  struct student{
  char Fname[];
  char Lname[];
  int reg_no;
  int Class;
  char sec;
  };
  
  void enterinfo(student *,int);
  void Display(student *,int);
  
  int main()
  {
  int i;
  
  printf("\t\t\t Enter student's information\n\n\n\n");
  printf("How many students are there in you're school: ");
  scanf("%d",&amp;i);
  student ob[i],*ptr;
  ptr=ob;
  enterinfo(ptr,i);
  Display(ptr,i);
  
  }
  
  
  
  
  void enterinfo(student *e,int y) 
  {
      char CONT='y';
  
  
          for (int j=0;j&lt;y &amp;&amp; (CONT=='y' || CONT=='Y');j++)
          {   
              printf("Enter Students First Name: ");
              scanf("%s",e-&gt;Fname);
              printf("Enter Students Last Name: ");
              scanf("%s",e-&gt;Lname);
              printf("Enter Roll number: ");
              scanf("%d",e-&gt;reg_no);
              printf("Enter class: ");
              scanf("%d",e-&gt;Class);
              printf("Enter Section: ");
              scanf("%d",e-&gt;sec);
  
              printf("\n\n\n\n Do you want to enter more?  : ");
              scanf("%c",&amp;CONT);
  
          }
  
  }
  
  
  
  
  
  
  void Display(student *e,int y) 
  {
       char CONT='y';
  
  
          for (int j=0;j&lt;y;j++)
          {   
              printf("Students name : %s %s",e-&gt;Fname,e-&gt;Lname);
  
              printf("Enter Roll number: %d",e-&gt;reg_no);
  
              printf("class: %d",e-&gt;Class);
  
              printf("Enter Section: %d",e-&gt;sec);
  
          }
  
  }
  </code></pre>