when i use a dynamic 2d char array using pointers, i dont get any errors but the program is not executed correctly...
//Pro to enter and display strings using dynamic 2d char array.
#include<iostream.h>
#include<conio.h>
void main()
{
char **v;
int s;
cout<<"Enter size :: ";
cin>>s;
v=new char[s];
cout<<"\nEnter "<<s<<" strings :: \n";
for(int i=0;i<s;i++)
cin>>v[i];
cout<<"The strings u entered are :: \n ";
for(i=0;i<s;i++)
cout<<v[i]<<"\n";
getch();
}
When I do that I get all the strings displayed except v[2]...ie 3rd string.I did it in primitive borlad compiler turbo c++ v3.0......When I do it in turbo c++ 5.0, the system does not allows it to run cause the program overloads the processor!! I would be pleased to get answer from u friends ...