#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std ;
struct st
{
char *p;
int Size ;
int length;
};
int main()
{
st s;
cout<<"Welcome to the String as an ADT program\n";
cout<<"Enter the maximum size of the string \n";
cin>>s.Size;
char str[s.Size];
cout<<"Enter your string \n";
gets(str);
s.p=str;
}
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?