title: My program doesnt show any compilation error but when it is run it exits abruptly every time
body: <pre><code>
  #include&lt;iostream&gt;
  #include&lt;cstdio&gt;
  #include&lt;cstring&gt;
  using namespace std ;
  struct st
  {
      char *p;
      int Size ;
      int length;
  };
  int main()
  {
   st s;
   cout&lt;&lt;"Welcome to the String as an ADT program\n";
   cout&lt;&lt;"Enter the maximum size of the string \n";
   cin&gt;&gt;s.Size;
   char str[s.Size];
   cout&lt;&lt;"Enter your string \n";
   gets(str);
   s.p=str;
  }
  </code></pre>
  
  <p>When i run this program there is no compilation error and the program runs fine, it asks me for the size of the string.Once i provide it with an integer number it shows "enter your string" question and exits from the output screen window without me able to enter the string. It happens every time. Kindly point out what is that i am doing wrong?</p>